Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

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

m (Replacing page with ' '''Warning See "Specifying EclipseLink Object-XML Mappings Using eclipselink-oxm.xml" in the [http://www.eclipse.org/eclipselink/documentation/...')
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{EclipseLink_UserGuide
 
|info=y
 
|toc=n
 
|eclipselink=y
 
|eclipselinktype=JPA
 
|examples=y
 
|example=*[[EclipseLink/Examples/JPA/EclipseLink-ORM.XML|EclipseLink-ORM.XML]]
 
*[[EclipseLink/Examples/JPA/EmployeeXML|Employee application]]
 
}}
 
  
=Specifying EclipseLink Object-Relational Mappings Using eclipselink-orm.xml=
 
You can use EclipseLink’s native metadata XML file, <tt>eclipselink-orm.xml</tt>, to override mappings defined in JPA’s configuration file <tt>orm.xml</tt> and to provide extended ORM features.
 
{{EclipseLink_Note
 
|note=Using the <tt>eclipselink-orm.xml</tt> mapping file enables many EclipseLink advanced features, but it may prevent the persistence unit from being portable to other JPA implementations.}}
 
  
The <tt>eclipselink-orm.xml</tt> 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
 
|link=
 
|section=Section 12.2 "XML Overriding Rules"
 
}}
 
  
See [[EclipseLink/XSDs]] for the <tt>eclipselink-orm.xsd</tt> schema.
+
'''[[Image:Elug_draft_icon.png|Warning]] See "Specifying EclipseLink Object-XML Mappings Using eclipselink-oxm.xml" in the [http://www.eclipse.org/eclipselink/documentation/ EclipseLink Concepts Guide]'''
==Overriding and Merging==
+
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]] for more information.
+
 
+
{{EclipseLink_JPA
+
|previous=[[EclipseLink/UserGuide/JPA/Basic JPA Development/Configuration/JPA/Defaults|Defaults]]
+
|next=[[EclipseLink/UserGuide/JPA/Basic JPA Development/Configuration/JPA/Overriding and Merging|Overriding and Merging]]
+
|up=[[EclipseLink/UserGuide/JPA/Basic JPA Development/Configuration|Configuration]]
+
|version=2.2.0 DRAFT}}
+

Latest revision as of 11:50, 25 January 2013


Warning See "Specifying EclipseLink Object-XML Mappings Using eclipselink-oxm.xml" in the EclipseLink Concepts Guide

Back to the top