// MyModel
String id
List<String> values
List<Long> scores;

// get(id)
PersistenceManager pm = ...getPersistenceManager();
try {
        return pm.getObjectById(MyModel.class, id);
} finally {
        pm.close();
}

// store(obj);
PersistenceManager pm = ...getPersistenceManager();
try {
        pm.makePersistent(obj);
} finally {
        pm.close();
}


MyModel m = new MyModel();
m.setId("key1");
m.addValue("value1");
m.addScore(100);
store(m);

Datastore (snapshot): I can see the following values in datastore
(thats ok).
key1, [value1], [100]

if I call get("key1") and print the properties, it prints only the id
but values and scores are always null

// I am trying to update like this
MyModel m = get("key1"); // values and scores property are null, only
id has the value.
m.addValue("value2");
m.addScore(200);
store(m); // this always replaces the old row in database.
i.e. now the database has only
key1, [value2], [200]

Why? Please help. I might be doing something wrong.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to