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

EclipseLink/Development/JPA 2.0/canonical model generation

< EclipseLink‎ | Development‎ | JPA 2.0
Revision as of 08:27, 20 October 2009 by Guy.pelletier.oracle.com (Talk | contribs) (Configuring and using within Eclipse Galileo)

Canonical model generation

JPA 2.0 Root | bug 267391

Discussion

Issue Summary

With the new Criteria API from the JPA 2.0 spec, EclipseLink will provide a way to produce static metamodel classes corresponding to the entities, mapped superclasses, and embeddable classes in the persistence unit. A static metamodel class models the persistent state and relationships of the corresponding managed class.

For portability, EclipseLink will generate the canonical metamodel as defined in section 6.2.1.1.

General solution

EclipseLink will employ the annotation processor tool (APT) in conjunction with its existing metadata processing of annotations and XML to generate the static metamodel classes.

For more information on APT, see: http://java.sun.com/j2se/1.5.0/docs/guide/apt/GettingStarted.html

Metadata processing

Configuring and using within Eclipse Galileo

The following steps outline how to configure the metamodel generation within the Eclipse IDE.

  1. Select Project - Properties
  2. Expand Java Compiler and select Annotation Processing.
  3. On the right, select the checkbox Enable annotation processing
  4. In the text box for Generated Source Directory enter the name of the directory to which you would like to generate the metamodel classes
  5. For other generating options, see section ?? below. By default the model generator will generate the metamodel classes as defined in the spec, however EclipseLink provides you with custom generation options.
  6. Expand

Configuring and using within ANT

1.2.0 RC4 Library names

Currently the target release of EclipseLink 1.2.0 is RC4 which uses the following jar files names in the ZIP installer. Please note that the ZIP installer is the only distribution of EclipseLink including the modelgen JAR file.

  1. Services file (enables the the processor).

\eclipselink\jlib\jpa\eclipselink-jpa-modelgen_1.2.0.v20091016-r5565.jar

  1. javax.persistence library

\eclipselink\jlib\jpa\javax.persistence_2.0_preview.jar

  1. EclipseLink jar

\eclipselink\jlib\eclipselink.jar

Troubleshooting

Work schedule

Future

Back to the top