I've posted a bug fix release candidate containing this fix here: http://datanucleus-appengine.googlecode.com/files/appengine-orm-1.0.4.1.RC1.zip
On Thu, Dec 10, 2009 at 11:51 AM, Max Ross (Google) < maxr+appeng...@google.com <maxr%2bappeng...@google.com>> wrote: > Found and fixed the issue: > http://code.google.com/p/datanucleus-appengine/issues/detail?id=171 > > > On Wed, Dec 9, 2009 at 11:48 AM, Max Ross (Google) < > maxr+appeng...@google.com <maxr%2bappeng...@google.com>> wrote: > >> Could you please post all the model objects that are involved in the >> example? Looks like SpeciesStats is missing. Also, it would be great if >> you could post the code that shows how you populate the Community object >> before persisting. >> >> Thanks, >> Max >> >> >> On Wed, Dec 9, 2009 at 11:40 AM, Max Ross (Google) < >> maxr+appeng...@google.com <maxr%2bappeng...@google.com>> wrote: >> >>> Thanks for the report, investigating now.... >>> >>> >>> On Tue, Dec 8, 2009 at 2:33 PM, Pierre Lavignotte < >>> pierre.lavigno...@gmail.com> wrote: >>> >>>> Hi, >>>> >>>> I have a problem when I try to inherit a one-to-many relation ship >>>> from a base entity class. >>>> >>>> The following model works fine : >>>> >>>> @PersistenceCapable(identityType = IdentityType.APPLICATION) >>>> @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE) >>>> public abstract class BaseEntity { >>>> >>>> @PrimaryKey >>>> @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) >>>> private Key key; >>>> >>>> public Key getKey() { >>>> return key; >>>> } >>>> } >>>> >>>> @PersistenceCapable(identityType = IdentityType.APPLICATION) >>>> public class Community extends BaseEntity { >>>> >>>> @Persistent >>>> @Element(dependent = "true") >>>> private List<SpeciesStats> stats = new ArrayList<SpeciesStats>(); >>>> >>>> public List<SpeciesStats> getStats() { >>>> return stats; >>>> } >>>> >>>> @Persistent(dependent = "true") >>>> TackleBox tackleBox; >>>> >>>> public TackleBox getTackleBox() { >>>> return tackleBox; >>>> } >>>> >>>> public void setTackleBox(TackleBox tackleBox) { >>>> this.tackleBox = tackleBox; >>>> } >>>> } >>>> >>>> @PersistenceCapable(identityType = IdentityType.APPLICATION) >>>> public class TackleBox extends BaseEntity { >>>> /* some other properties that eventually extend BaseEntity and so on >>>> */ >>>> } >>>> >>>> But if I move "private List<SpeciesStats> stats" from Community to >>>> BaseEntity, I get a runtime exception when trying to read a Community >>>> entity : >>>> Caused by: java.lang.NullPointerException >>>> at org.datanucleus.store.appengine.DatastoreTable.runCallBacks >>>> (DatastoreTable.java:1025) >>>> at org.datanucleus.store.appengine.DatastoreTable.initializeNonPK >>>> (DatastoreTable.java:391) >>>> at org.datanucleus.store.appengine.DatastoreTable.buildMapping >>>> (DatastoreTable.java:285) >>>> at >>>> org.datanucleus.store.appengine.DatastoreManager.buildStoreData >>>> (DatastoreManager.java:405) >>>> at org.datanucleus.store.appengine.DatastoreManager.newStoreData >>>> (DatastoreManager.java:363) >>>> at org.datanucleus.store.AbstractStoreManager.addClasses >>>> (AbstractStoreManager.java:788) >>>> at org.datanucleus.store.AbstractStoreManager.addClass >>>> (AbstractStoreManager.java:759) >>>> at >>>> org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass >>>> (MappedStoreManager.java:358) >>>> at >>>> org.datanucleus.store.appengine.DatastoreManager.getDatastoreClass >>>> (DatastoreManager.java:631) >>>> at >>>> org.datanucleus.store.appengine.query.DatastoreQuery.performExecute >>>> (DatastoreQuery.java:212) >>>> at >>>> org.datanucleus.store.appengine.query.JDOQLQuery.performExecute >>>> (JDOQLQuery.java:85) >>>> at >>>> org.datanucleus.store.query.Query.executeQuery(Query.java:1489) >>>> at org.datanucleus.store.query.Query.executeWithArray(Query.java: >>>> 1371) >>>> at org.datanucleus.store.query.Query.execute(Query.java:1344) >>>> at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:221) >>>> >>>> Or trying to persist one : >>>> >>>> java.lang.NullPointerException >>>> at org.datanucleus.store.appengine.DatastoreTable.runCallBacks >>>> (DatastoreTable.java:1025) >>>> at org.datanucleus.store.appengine.DatastoreTable.initializeNonPK >>>> (DatastoreTable.java:391) >>>> at org.datanucleus.store.appengine.DatastoreTable.buildMapping >>>> (DatastoreTable.java:285) >>>> at >>>> org.datanucleus.store.appengine.DatastoreManager.buildStoreData >>>> (DatastoreManager.java:405) >>>> at org.datanucleus.store.appengine.DatastoreManager.newStoreData >>>> (DatastoreManager.java:363) >>>> at org.datanucleus.store.AbstractStoreManager.addClasses >>>> (AbstractStoreManager.java:788) >>>> at org.datanucleus.store.AbstractStoreManager.addClass >>>> (AbstractStoreManager.java:759) >>>> at >>>> org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass >>>> (MappedStoreManager.java:358) >>>> at >>>> org.datanucleus.store.appengine.DatastoreManager.getDatastoreClass >>>> (DatastoreManager.java:631) >>>> at >>>> >>>> org.datanucleus.store.appengine.DatastoreFieldManager.buildMappingConsumer >>>> (DatastoreFieldManager.java:1008) >>>> at >>>> >>>> org.datanucleus.store.appengine.DatastoreFieldManager.buildMappingConsumer >>>> (DatastoreFieldManager.java:998) >>>> at org.datanucleus.store.appengine.DatastoreFieldManager.<init> >>>> (DatastoreFieldManager.java:133) >>>> at org.datanucleus.store.appengine.DatastoreFieldManager.<init> >>>> (DatastoreFieldManager.java:167) >>>> at >>>> >>>> org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPreProcess >>>> (DatastorePersistenceHandler.java:316) >>>> at >>>> >>>> org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects >>>> (DatastorePersistenceHandler.java:236) >>>> at >>>> org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject >>>> (DatastorePersistenceHandler.java:225) >>>> at >>>> org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent >>>> (JDOStateManagerImpl.java:3185) >>>> at org.datanucleus.state.JDOStateManagerImpl.makePersistent >>>> (JDOStateManagerImpl.java:3161) >>>> at org.datanucleus.ObjectManagerImpl.persistObjectInternal >>>> (ObjectManagerImpl.java:1298) >>>> at org.datanucleus.ObjectManagerImpl.persistObject >>>> (ObjectManagerImpl.java:1175) >>>> at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent >>>> (JDOPersistenceManager.java:669) >>>> at org.datanucleus.jdo.JDOPersistenceManager.makePersistent >>>> (JDOPersistenceManager.java:694) >>>> >>>> Same thing if Community inherits from another class that have a >>>> List<SpeciesStats> properties, so Community is the only class that >>>> have this property. >>>> >>>> What's wrong ? Did I miss something with the anotations ? >>>> >>>> Thanks, >>>> Pierre >>>> >>>> -- >>>> >>>> You received this message because you are subscribed to the Google >>>> Groups "Google App Engine for Java" group. >>>> To post to this group, send email to >>>> google-appengine-j...@googlegroups.com. >>>> To unsubscribe from this group, send email to >>>> google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com> >>>> . >>>> For more options, visit this group at >>>> http://groups.google.com/group/google-appengine-java?hl=en. >>>> >>>> >>>> >>> >> > -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.