You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2013/03/26 09:14:37 UTC

svn commit: r1461009 - in /isis/site/trunk/content: components/objectstores/jdo/about.md components/objectstores/jdo/deploying-on-the-google-app-engine.md components/objectstores/jdo/enabling-logging.md documentation.md

Author: danhaywood
Date: Tue Mar 26 08:14:36 2013
New Revision: 1461009

URL: http://svn.apache.org/r1461009
Log:
isis site - gae hints and tips

Added:
    isis/site/trunk/content/components/objectstores/jdo/deploying-on-the-google-app-engine.md
Modified:
    isis/site/trunk/content/components/objectstores/jdo/about.md
    isis/site/trunk/content/components/objectstores/jdo/enabling-logging.md
    isis/site/trunk/content/documentation.md

Modified: isis/site/trunk/content/components/objectstores/jdo/about.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/components/objectstores/jdo/about.md?rev=1461009&r1=1461008&r2=1461009&view=diff
==============================================================================
--- isis/site/trunk/content/components/objectstores/jdo/about.md (original)
+++ isis/site/trunk/content/components/objectstores/jdo/about.md Tue Mar 26 08:14:36 2013
@@ -8,7 +8,9 @@ Hints and tips:
 - [Dates, Blobs and Lazy Loading](dates-blobs-lazy-loading.html)
 - [Using a JNDI Datasource](using-jndi-datasource.html) [1.1.0-SNAPSHOT]
 - [Eagerly Registering Entities](eagerly-registering-entities.html) [1.1.0-SNAPSHOT]
-- [Enabling Logging](enabling-logging.html) [stub]
+- [Enabling Logging](enabling-logging.html)
+- [Deploying on the Google App Engine](deploying-on-the-google-app-engine.html)
+
 
 ### Releases
 

Added: isis/site/trunk/content/components/objectstores/jdo/deploying-on-the-google-app-engine.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/components/objectstores/jdo/deploying-on-the-google-app-engine.md?rev=1461009&view=auto
==============================================================================
--- isis/site/trunk/content/components/objectstores/jdo/deploying-on-the-google-app-engine.md (added)
+++ isis/site/trunk/content/components/objectstores/jdo/deploying-on-the-google-app-engine.md Tue Mar 26 08:14:36 2013
@@ -0,0 +1,42 @@
+Title: Deploying on the Google App Engine
+
+The Google App Engine (GAE) provides a JDO API, meaning that you can deploy Isis onto GAE using the JDO objectstore.
+
+However, GAE is not an RDBMS, and so there are some limitations that it imposes.  This page gathers together various hints, tips and workarounds.
+
+### Primary Keys and Owned/Unowned Relationships
+
+All entities must have a `@PrimaryKey`.  Within GAE, the type of this key matters.
+
+For an entity to be an aggregate root, (ie a root of an GAE entity group), its key must be a `Long`, eg:
+
+<pre>
+    @Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
+    @PrimaryKey
+    private Long id;
+</pre>
+
+Any collection that holds this entity type (eg `ToDoItem#dependencies` holding a collection of `ToDoItem`s) should then be annotated with `@Unowned` (a GAE annotation).
+
+If on the other hand you want the object to be owned (through a 1:m relationship somewhere) by some other root, then use a String:
+
+<pre>
+@PrimaryKey
+@Persistent(valueStrategy = javax.jdo.annotations.IdGeneratorStrategy.IDENTITY)
+@Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
+private String key;
+</pre>
+
+Note: if you store a relationship with a String key it means that the parent object *owns* the child, any attempt to change the relationship raise and exception.
+
+### Custom Types
+
+Currently Isis' `Blob` and `Clob` types and the JODA types (`LocalDate` et al) are *not* supported in GAE.
+
+Instead, GAE defines a [fixed set of value types](https://developers.google.com/appengine/docs/java/datastore/entities#Properties_and_Value_Types), including `BlobKey`.  Members of the Isis community have this working, though I haven't seen the code.
+
+The above notwithstanding, Andy Jefferson at DataNucleus tells us:
+
+> GAE JDO/JPA does support *some* type conversion, because looking at [[1]](http://code.google.com/p/datanucleus-appengine/source/browse/trunk/src/com/google/appengine/datanucleus/StoreFieldManager.java#349) for any field that is Object-based and not a relation nor Serialized it will call [[2]](http://code.google.com/p/datanucleus-appengine/source/browse/trunk/src/com/google/appengine/datanucleus/TypeConversionUtils.java#736) and that looks for a `TypeConverter` (specify `@Extension` with key of "type-converter-name" against a field and value as the `TypeConverter` class) and it should convert it. Similarly when getting the value from the datastore.
+
+We'll update these notes as and when this gets confirmed.

Modified: isis/site/trunk/content/components/objectstores/jdo/enabling-logging.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/components/objectstores/jdo/enabling-logging.md?rev=1461009&r1=1461008&r2=1461009&view=diff
==============================================================================
--- isis/site/trunk/content/components/objectstores/jdo/enabling-logging.md (original)
+++ isis/site/trunk/content/components/objectstores/jdo/enabling-logging.md Tue Mar 26 08:14:36 2013
@@ -1,9 +1,5 @@
 Title: Enabling Logging
 
-{note
-this article is just a stub
-}
-
 Sometimes you just need to see what is going on.  There are various ways in which logging can be enabled, here are some ideas.
 
 ### In Apache Isis

Modified: isis/site/trunk/content/documentation.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/documentation.md?rev=1461009&r1=1461008&r2=1461009&view=diff
==============================================================================
--- isis/site/trunk/content/documentation.md (original)
+++ isis/site/trunk/content/documentation.md Tue Mar 26 08:14:36 2013
@@ -173,7 +173,9 @@ Guidance for committers is at the bottom
 - [Dates, Blobs and Lazy Loading](components/objectstores/jdo/dates-blobs-lazy-loading.html)
 - [Using a JNDI Datasource](components/objectstores/jdo/using-jndi-datasource.html) [1.1.0-SNAPSHOT]
 - [Eagerly Registering Entity Types](components/objectstores/jdo/eagerly-registering-entities.html) [1.1.0-SNAPSHOT]
-- [Enabling Logging](components/objectstores/jdo/enabling-logging.html) [stub]
+- [Enabling Logging](components/objectstores/jdo/enabling-logging.html)
+- [Deploying on the Google App Engine](components/objectstores/jdo/deploying-on-the-google-app-engine.html)
+
 }
 
 {span-one-third