Doh! I was searching for Open issues, not All issues. This one is marked as Fixed, so I missed it. Oops.
On Nov 12, 12:30 pm, "Max Ross (Google)" <[email protected]> wrote: > Looks like you're running > intohttp://code.google.com/p/datanucleus-appengine/issues/detail?id=126 > > This is a lousy bug report, and I can say that without fear of offending > anyone because I'm responsible for it. > > The fix will be available in the next SDK (currently working its way through > QA). In the meantime the workaround is to use a Key primary key on the > parent object. > > Sorry for the trouble, > Max > > On Wed, Nov 11, 2009 at 10:23 PM, Peter Recore <[email protected]>wrote: > > > Here's the stacktrace I get when calling remove on a list containing > > child elements of a one to many owned relationship. > > > java.lang.ClassCastException: java.lang.Long cannot be cast to > > java.lang.String > > at > > org.datanucleus.store.appengine.DatastoreFKListStoreSpecialization.removeAt > > (DatastoreFKListStoreSpecialization.java:155) > > at org.datanucleus.store.mapped.scostore.FKListStore.removeAt > > (FKListStore.java:525) > > at org.datanucleus.store.mapped.scostore.AbstractListStore.remove > > (AbstractListStore.java:318) > > at org.datanucleus.sco.backed.List.remove(List.java:907) > > at usabletek.plyus.server.TestEntity.demonstrateProblem > > (TestEntity.java:31) > > > I'm trying to figure out if I'm not allowed to use Longs as primary > > keys, or if this is a bug, or if I'm doing something else wrong with > > the relationship. > > Here's as minimal an example as I can come up with: > > > @PersistenceCapable(identityType = IdentityType.APPLICATION) > > public class TestEntity { > > �...@primarykey > > �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > > private Long id; > > > �...@persistent(mappedBy = "parent") > > private List<TestChildEntity> childEntities; > > > public List<TestChildEntity> getChildEntities() { > > return childEntities; > > } > > > public static void demonstrateProblem(){ > > PersistenceManager pm = PMF.get().getPersistenceManager(); > > TestEntity te = new TestEntity(); > > pm.makePersistent(te); > > te.getChildEntities().add(new TestChildEntity("a")); > > te.getChildEntities().remove(0); > > pm.close(); > > } > > } > > > @PersistenceCapable(identityType = IdentityType.APPLICATION) > > public class TestChildEntity { > > �...@primarykey > > �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > > �...@extension(vendorName = "datanucleus", key = "gae.encoded-pk", > > value > > = "true") > > private String encodedKey; > > > �...@persistent > > �...@extension(vendorName = "datanucleus", key = "gae.pk-name", value > > = > > "true") > > private String keyName; > > > �...@persistent > > private TestEntity parent; > > > public TestChildEntity(String k){ > > this.keyName = k; > > } > > } > > > -- > > > 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 > > [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<google-appengine-java%[email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/google-appengine-java?hl=. -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=.
