Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-3247

In GAE "child" entities can't have an ID of type Long

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.2.2.RELEASE
    • None
    • GAE, GWT
    • None

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            r.w.lincoln Richard Lincoln
            Archiver:
            tmarshall Trevor Marshall

            Dates

              Created:
              Updated:
              Archived: