Description
In GAE and DataNucleus (DN) "child" entities can not have an ID of type Long. Instead they must either use a com.google.appengine.api.datastore.Key or an encoded String. Specifying Key as the identifierType in the @RooJpaActiveRecord annotation causes problems when running web gwt all because there is no client side equivalent that GWT can translate. The alternative is to create an id field of type String with a getter and a setter and annotate it as a DN Extension:
@javax.persistence.Id @javax.persistence.GeneratedValue(strategy = javax.persistence.GenerationType.IDENTITY) @org.datanucleus.api.jpa.annotations.Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true") private String id; public String getId() {return this.id;} public void setId(String id) {this.id = id;}
This clutters up each "child" entities class. Perhaps the GWT add-on should handle conversion to and from a String using com.google.appengine.api.datastore.KeyFactory if a Key type is specified.