Community
Participate
Working Groups
1. Create a Generic 2.0 JPA project with an orm.xml file 2. Set a canonical metamodel source folder on the JPA properties page. 3. Add this JPA entity: @Entity public class Bar { @Id private int id; } 4. Add the Bar entity to the orm.xml file. The attached CCE appears in the error log. java.lang.ClassCastException: org.eclipse.jpt.jpa.core.internal.context.orm.VirtualOrmPersistentAttribute cannot be cast to org.eclipse.jpt.jpa.core.context.PersistentAttribute at org.eclipse.jpt.jpa.core.internal.jpa2.GenericMetamodelSynchronizer.printAttributesOn(GenericMetamodelSynchronizer.java:345)
Created attachment 197960 [details] stack trace
Created attachment 197965 [details] proposed patch against head This patch includes a minor API change: MetamodelSourceType.attributes() generic type had to be changed to ReadOnlyPersistentAttribute from PersistentAttribute. I think this change is warranted because this bug breaks metamodel generation in the orm.xml case if any attribute is not specified in the orm.xml file.
checked in to HEAD for 3.0.1
Verified in Build I-3.4.0-20110731180834 Verified you add an entity to orm.xml if the canonical metamodel source folder is already set. See the link to view test steps for verification. http://wiki.eclipse.org/Dali_3.0.1