MountainClimb / datanucleus-appengine

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

Support datastore-identity #236

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I see nothing in GAE/J Datastore that prevents the support of datastore 
identity. That is, a surrogate property is created in the datastore to contain 
a datastore-generated identity value.

While doing this, insertObject of DatastorePersistenceHandler ought to be fixed 
so that you do not always call op.setPostStoreNewObjectId(). This method should 
only be called when the datastore has been used to create an identity (i.e 
"IDENTITY" value generator). If using "SEQUENCE" value generator then the value 
is generated before persist, hence there is no "identity" to update. Similarly, 
if the user decided to use "uuid" value-generator then this is generated 
in-memory before persist too.

Original issue reported on code.google.com by googleco...@yahoo.co.uk on 14 Jul 2011 at 10:24

GoogleCodeExporter commented 8 years ago

Original comment by googleco...@yahoo.co.uk on 21 Sep 2011 at 3:53

GoogleCodeExporter commented 8 years ago
SVN trunk now contains basic support for datastore-identity. Tested on simple 
case using Long and IDENTITY strategy

Original comment by googleco...@yahoo.co.uk on 30 Sep 2011 at 7:43

GoogleCodeExporter commented 8 years ago
SVN trunk now allows datastore identity, namely

@PersistenceCapable
@DatastoreIdentity(strategy=IDENTITY)
public class MyClass
{
   ...
}

so no need to specify Keys or primary key fields

Original comment by googleco...@yahoo.co.uk on 30 Sep 2011 at 10:50