I am having an issue loading Collections after they have been stored
in the datastore. I have simplified this issue down to a simple
example listed below. If I run with the current comments, everything
works fine, and the Collections are loaded. If I uncomment "foo1" or
"foo2", the Collections no longer load (they are null). If I
uncomment the constructor where I add values to the list, everything
works fine again.
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Player2 {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
public Long key;
//@Persistent
//private Long foo1; //Cause Collection issue
//@Persistent
//private String foo2; //Causes Collection issue
@Persistent
private Key foo3; // This works
@Persistent(defaultFetchGroup = "true")
private Set<Long> longSet = new HashSet<Long>();
@Persistent(defaultFetchGroup = "true")
private List<Long> longList = new ArrayList<Long>();
@Persistent(defaultFetchGroup = "true")
private Set<String> stringSet = new HashSet<String>();
@Persistent(defaultFetchGroup = "true")
private List<String> stringList = new LinkedList<String>();
@Persistent(defaultFetchGroup = "true")
private Set<Key> keySet = new HashSet<Key>();
@Persistent(defaultFetchGroup = "true")
private List<Key> keyList = new LinkedList<Key>();
public Player2() {
//Adding to the List Fixes Collection issue
//longSet.add(1234l);
//longList.add(1234l);
//stringSet.add("1234l");
//stringList.add("1234l");
//keySet.add(KeyFactory.createKey(Player2.class.getSimpleName
(), "[email protected]"));
//keyList.add(KeyFactory.createKey(Player2.class.getSimpleName
(), "[email protected]"));
}
}
I believe this might be a similar issue to this thread:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/a44cb049f40d6bab/f9047e0a25e3453f?lnk=gst&q=JDO+collection+null#f9047e0a25e3453f
But when I run with in either of the successful ways, the Collections
don't seem to be SCO fields. I will also post in that thread in case
it helps with the ticket.
Thanks,
Jeff
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---