I'm moving from JPA 1 to JPA 2 in my Gooogle App Engine project, and for that I changed the annotations for collections of enums, like this case:
// @OneToMany(cascade = CascadeType.ALL) // JPA 1
@ElementCollection(targetClass=PositioningType.class)
private List<PositioningType> bestPositionings;
PositioningType
is an enum that is not annotated.
That code is giving me the following exception:
javax.persistence.PersistenceException: The MetaData for the element class "com.olympya.datamodel.model.PositioningType" of the collection field "com.olympya.datamodel.model.Player.bestPositionings" was not found.
at org.datanucleus.api.jpa.NucleusJPAHelper.getJPAExceptionForNucleusException(NucleusJPAHelper.java:302)
at org.datanucleus.api.jpa.JPAEntityTransaction.commit(JPAEntityTransaction.java:122)
at com.olympya.Services.mergeUser(Services.java:102)
...
Caused by: org.datanucleus.exceptions.NucleusUserException: The MetaData for the element class "com.olympya.datamodel.model.PositioningType" of the collection field "com.olympya.datamodel.model.Player.bestPositionings" was not found.
at com.google.appengine.datanucleus.scostore.AbstractFKStore.<init>(AbstractFKStore.java:120)
at com.google.appengine.datanucleus.scostore.FKListStore.<init>(FKListStore.java:83)
at com.google.appengine.datanucleus.DatastoreManager.newFKListStore(DatastoreManager.java:472)
at org.datanucleus.store.mapped.MappedStoreManager.getBackingStoreForCollection(MappedStoreManager.java:798)
at org.datanucleus.store.mapped.MappedStoreManager.getBackingStoreForField(MappedStoreManager.java:709)
at org.datanucleus.store.types.sco.backed.ArrayList.<init>(ArrayList.java:99)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
...
@ElementCollection
@Extension(vendorName = "datanucleus", key = "gae.unindexed", value = "true")
//private List<PositioningType> bestPositionings = new ArrayList<PositioningType>();
private List<Integer> bestPositionings;
Results in:
Caused by: org.datanucleus.exceptions.NucleusUserException: The MetaData for the element class "java.lang.Integer" of the collection field "com.olympya.datamodel.model.Player.bestPositionings" was not found.
at com.google.appengine.datanucleus.scostore.AbstractFKStore.<init>(AbstractFKStore.java:120)
at com.google.appengine.datanucleus.scostore.FKListStore.<init>(FKListStore.java:83)
at com.google.appengine.datanucleus.DatastoreManager.newFKListStore(DatastoreManager.java:472)
at org.datanucleus.store.mapped.MappedStoreManager.getBackingStoreForCollection(MappedStoreManager.java:798)
at org.datanucleus.store.mapped.MappedStoreManager.getBackingStoreForField(MappedStoreManager.java:709)
at org.datanucleus.store.types.sco.backed.ArrayList.<init>(ArrayList.java:99)
--To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/M9bihLLrsTAJ.
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.