Google AppEngine/Datastore

GAE

DataNucleus supports persisting/retrieving objects to/from Google AppEngine/Datastore (using the datanucleus-appengine plugin). Simply specify your connection details as follows

datanucleus.ConnectionURL=appengine:

Version 3.0.x of the datanucleus-appengine plugin is for use with DataNucleus v3.2/v3.3 (see SVN trunk of the GAE plugin). Since Google have been incredibly lazy in releasing this version of their appengine plugin, we have put one in the DataNucleus Maven repository which you can use with DataNucleus AccessPlatform 3.3.

Once you have specified your connection details you then create your PMF/EMF as normal and use JDO/JPA as normal. Things to bear in mind with AppEngine/Datastore usage :-

  • Querying can be performed using JDOQL or JPQL. Some query constructs are evaluated in the datastore, and you can request that any others are handled in-memory. If you want queries to automatically evaluate unsupported constructs in-memory just set the persistence property datanucleus.appengine.query.inMemoryWhenUnsupported to "true"
  • Relation Mode : by default all relations are owned meaning that when related objects are persisted they are owned by the original object and their "id" contains the Key of the owner object. You can set datanucleus.appengine.relationDefault to unowned and make all relations default to unowned, just like all other supported datastores

References

Some references that may be of some use