Adding or overriding entity mappings in the orm.xml file
You can use the Object Relational Mapping XML Editor to define object-relational mappings for JPA entity beans in the orm.xml file.
About this task
When you specify object-relational mappings using the JPA tools, the mapping information is contained in the Java™ class files in the form of Java annotations. However, you can also choose to define the object-relational mappings in XML in a file called orm.xml.
Mapping information that is defined in the orm.xml file automatically overrides both default JPA behavior and any mappings defined using annotations. Therefore, you can, for example, to adapt existing JPA entity beans to a different set of database tables without needing to modify the entity class files.
To edit the orm.xml file that is in the META-INF directory of the JPA project:
Procedure
- In the Package Explorer view, right-click the orm.xml file of the JPA project that you want to edit, and select .
- In the Design tab of the Object Relational Mapping XML Editor, add object-relational mapping information.
- Click to save your changes.