dipaksavaliya / datanucleus-appengine

Automatically exported from code.google.com/p/datanucleus-appengine
0 stars 0 forks source link

Investigate pm.getXXX methods that don't take a Class arg #164

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
pm.getObjectbyId() and pm.getObjectsById()

Can we make these work?

Original issue reported on code.google.com by max.r...@gmail.com on 23 Nov 2009 at 6:11

GoogleCodeExporter commented 8 years ago
JDO operates the same as it should with those methods.
tx.begin();
pm.makePersistent(myObj);
tx.commit();
Object id = pm.getObjectId(myObj);
...
tx.begin();
MyClass myObj = (MyClass)pm.getObjectById(id);

See the foot of JDOFetchTest for a simple test of this. The "id" passed in is a 
JDO identity, not your internal datastore identity (and nor should it be your 
identity to be JDO compliant)

Original comment by googleco...@yahoo.co.uk on 18 Jul 2011 at 9:46