The page documenting the eclipselink-orm.xml file says, in part:
Quote:This mapping file can be used in place of JPA's standard mapping file or can be used to override a JPA mapping file.
I'm interested in doing the latter, not the former.
Accordingly, I put the following in my META-INF/persistence.xml file:
<mapping-file>META-INF/my-orm.xml</mapping-file>
<mapping-file>META-INF/my-eclipselink-orm.xml</mapping-file>
They are picked up just fine.
Now, note that I do not want the contents of my-eclipselink-orm.xml to be a superset of the contents of my-orm.xml. I just want to put the bare minimum of XML necessary in it to (semantically) add certain EclipseLink-specific features to a given mapping specified in my-orm.xml.
So now suppose I have a <one-to-many> mapping in my-orm.xml named names. (Basic, basic stuff.)
Suppose now in my-eclipselink-orm.xml I'd like to semantically add the <batch-fetch> element to that mapping.
If I do this:
<entity class="the.entity.class.in.Question">
<attributes>
<one-to-many name="names">
<batch-fetch size="10" type="JOIN"/>
</one-to-many>
</attributes>
</entity>
...then EclipseLink yells at me:
Conflicting XML elements [<one-to-many>] with the same name [names] were found. The first was found in the mapping file [file:/Users/ljnelson/Projects/foo/target/classes/META-INF/my-eclipselink-orm.xml] and the second in the mapping file [file:/Users/ljnelson/Projects/foo/target/classes/META-INF/my-real-orm.xml]. Named XML elements must be unique across the persistence unit.
So how do I override only certain parts of a "real" orm.xml with an eclipselink-orm.xml?
Thanks in advance!