Hello;
https://wiki.eclipse.org/EclipseLink/Examples/JPA/EclipseLink-ORM.XML says, in part:
"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.
In my persistence.xml, I have this:
<mapping-file>META-INF/my-real-orm.xml</mapping-file>
<mapping-file>META-INF/my-eclipselink-orm.xml</mapping-file>
In my-real-orm.xml, I have an <entity> mapping that includes a one-to-many mapping on an attribute named "names". It's very straightforward.
In my-eclipselink-orm.xml, all that I am interested in doing is adding a <batch-fetch> element to the particular one-to-many mapping mentioned above.
When I add the bare minimum of XML to my-eclipselink-orm.xml to accomplish this, I receive the following error:
"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."
The bare minimum looks like 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>
I'm unclear how an eclipselink-orm.xml file can override a JPA mapping file if this is the case. How do I designate the entity whose XML mapping information should be augmented?
Best,
Laird