Jump to: navigation, search

Difference between revisions of "EclipseLink/UserGuide/JPA/Basic JPA Development/Configuration/JPA/eclipselink-orm.xml"

m
m
Line 10: Line 10:
  
 
=eclipselink-orm.xml=
 
=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 EclipseLink with extended ORM features.  
+
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.  
 
{{EclipseLink_Note
 
{{EclipseLink_Note
|note=Using the '''eclipselink-orm.xml''' mapping file will enable many EclipseLink advanced features, but may prevent the persistence unit from being portable to other JPA implementations.}}
+
|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 the object-relational mapping metadata for EclipseLink. It is built from the existing [[EclipseLink/UserGuide/JPA/Basic JPA Development/Configuration/JPA/orm.xml|orm.xml file]] which makes it more intuitive, requires minimum configuration, and makes it easy to override.  
+
The '''eclipselink-orm.xml''' file defines object-relational mapping metadata for EclipseLink. It is built from the existing [[EclipseLink/UserGuide/JPA/Basic JPA Development/Configuration/JPA/orm.xml|orm.xml file]] which makes it more intuitive, requires minimum configuration, and makes it easy to override.  
 
{{EclipseLink_Spec
 
{{EclipseLink_Spec
 
|link=
 
|link=

Revision as of 12:01, 21 March 2011

EclipseLink JPA


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.

Elug note icon.png

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.

Elug javaspec icon.gif

For more information, see Section 12.2 "XML Overriding Rules" in the JPA Specification.

Overriding and Merging

To override 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 for more information


Eclipselink-logo.gif
Version: 2.2.0 DRAFT
Other versions...