Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 347760

Summary: Creation of Canonical Metamodel only possible when using annotations
Product: z_Archived Reporter: Mladen G. <mladen.girazovski>
Component: EclipselinkAssignee: Project Inbox <eclipselink.orm-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: brian.vosburgh, tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Mladen G. CLA 2011-05-31 07:19:44 EDT
Build Identifier: 2.2.0.v20110202-r8913

Currently EclipseLink only supports the creation of an Canonical Metamodel if JPA or Eclipselink Annotations are used.

org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor extends javax.annotation.processing.AbstractProcessor, so if only orm.xml and/or eclipselink-orm.xml are used to define mappings, CanonicalModelProcessor will not get triggered and no metamodel will be created.

The JPA 2.0 Spec does not define that a JPA implementor has to provide any means to generate a canonical metamodel. 
Still, it would be useful to have to possibility to generate the metamodel even if no JPA/EclipseLink Annotations are used, allowing users to define their mapping solely in mapping files like orm.xml or eclipselink-orm.xml without losing the option to generate a canonical metamodel.

Reproducible: Always

Steps to Reproduce:
1. Create a JPA/Eclipselink project, using no JPA/EclipseLink annotations at all, just the orm.xml and/or eclipselink-orm.xml file to define mappings
2. Try to run the CanonicalModelProcessor
3. The CanonicalModelProcessor was not triggered at all, thus no metamodel was generated
Comment 1 Tom Ware CLA 2011-06-09 10:12:16 EDT
Workaround is to put one javax.persistence or one org.eclipse.persistence.annotations annotation somewhere in your model.
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:02:31 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:10:44 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink