Hello,
I am having a strange problem with persisting a collection of a POJO
using the JDO in GAE. For example, the following data classes would
persist fine:
// This works
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class JDOData {
@PrimaryKey
private String key;
@Persistent
private List<MyLong> MyLongs;
}
@PersistenceCapable()
@EmbeddedOnly
public class MyLong{
@Persistent
private long myLong;
}
But JDOData will no longer persist if I change it to the following:
// This no longer works
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class JDOData {
@PrimaryKey
private String key;
@Persistent
private MyLongList myLongList;
}
@PersistenceCapable()
@EmbeddedOnly
public class MyLongList{
@Persistent
private List<MyLong> MyLongs;
}
@PersistenceCapable()
@EmbeddedOnly
public class MyLong{
@Persistent
private long myLong;
}
I got the following exceptions when persisting the changes above:
javax.jdo.JDOFatalUserException: Specified class class
java.lang.String is not persistable
at
org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:
354)
at
org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:
674)
at
org.datanucleus.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:
694)
The last stack trace is cryptic. Do I have a problem in my data class
definitions or is it because GAE cannot persist embedded collections
two level down?
Thanks,
yc
--
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=en.