Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] JPA section 8.2.1.6.2 question: orm.xml/eclipselink-orm.xml automatically picked up?

I'm trying to figure out when META-INF/orm.xml files are processed automatically.

Section 8.2.1.6.2 of the JPA specification implies that if I name an object-relational mapping file orm.xml and locate it in a META-INF directory of any archive that contains classes being treated as entities, then all such files will be automatically picked up.

But it's actually a pretty unclear section.  You could also read section 8.2.1.6.2 as saying that only one will be picked up automatically, namely the META-INF/orm.xml present at the root of the persistence unit.

I'm not sure which is correct.

Example: I have a .jar file in the lib directory of my .ear file.  It contains META-INF/persistence.xml, thus defining the root of a persistence unit.  I have many other .jar files in that lib directory as well, many of which contain entity classes.  (The entity classes are all processed correctly and normally by EclipseLInk.)  If I place META-INF/orm.xml files in some of those .jar files, but do not reference them explicitly from my persistence.xml, is it supposed to be the case that they all are automatically processed?  Or must I reference each one via a <mapping-file> element?

Would this be true of META-INF/eclipselink-orm.xml as well?

(Background: trying to get batch-fetch elements in META-INF/eclipselink-orm.xml files recognized; not having much luck.)

Best,
Laird
 
--
http://about.me/lairdnelson

Back to the top