Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EclipseLink/UserGuide/JPA/Basic JPA Development/Configuration/JPA/eclipselink-orm.xml"
m |
|||
Line 24: | Line 24: | ||
To override the <tt>orm.xml</tt> file's mapping, you must define the <tt>META-INF/eclipselink-orm.xml</tt> file in the project. When both <tt>orm.xml</tt> and <tt>eclipselink-orm.xml</tt> are specified, the contents of <tt>eclipselink-orm.xml</tt> override <tt>orm.xml</tt> and any other JPA mapping file specified in the persistence unit. If there are overlapping specifications in multiple ORM files, the files are merged if they are no conflicting entities. | To override the <tt>orm.xml</tt> file's mapping, you must define the <tt>META-INF/eclipselink-orm.xml</tt> file in the project. When both <tt>orm.xml</tt> and <tt>eclipselink-orm.xml</tt> are specified, the contents of <tt>eclipselink-orm.xml</tt> override <tt>orm.xml</tt> and any other JPA mapping file specified in the persistence unit. If there are overlapping specifications in multiple ORM files, the files are merged if they are no conflicting entities. | ||
− | See [[EclipseLink/UserGuide/JPA/Basic JPA Development/Configuration/JPA/Overriding and Merging|Overriding and Merging Metadata | + | See [[EclipseLink/UserGuide/JPA/Basic JPA Development/Configuration/JPA/Overriding and Merging|Overriding and Merging Metadata Values]] for more information. |
{{EclipseLink_JPA | {{EclipseLink_JPA |
Revision as of 10:52, 27 April 2011
EclipseLink JPA
EclipseLink | |
Website | |
Download | |
Community | |
Mailing List • Forums • IRC • mattermost | |
Issues | |
Open • Help Wanted • Bug Day | |
Contribute | |
Browse Source |
Examples
Specifying EclipseLink Object-Relational Mappings Using eclipselink-orm.xml
You can use EclipseLink’s native metadata XML file, eclipselink-orm.xml, to override mappings defined in JPA’s configuration file orm.xml and to provide extended ORM features.
Note: Using the eclipselink-orm.xml mapping file enables many EclipseLink advanced features, but it may prevent the persistence unit from being portable to other JPA implementations.
The eclipselink-orm.xml file defines object-relational mapping metadata for EclipseLink. It is built from the existing orm.xml file which makes it more intuitive, requires minimum configuration, and makes it easy to override.
For more information, see Section 12.2 "XML Overriding Rules" in the JPA Specification.
See EclipseLink/XSDs for the eclipselink-orm.xsd schema.
Overriding and Merging
To override the orm.xml file's mapping, you must define the META-INF/eclipselink-orm.xml file in the project. When both orm.xml and eclipselink-orm.xml are specified, the contents of eclipselink-orm.xml override orm.xml and any other JPA mapping file specified in the persistence unit. If there are overlapping specifications in multiple ORM files, the files are merged if they are no conflicting entities.
See Overriding and Merging Metadata Values for more information.