Announcement Announcement Module
Collapse
No announcement yet.
Google App Engine data types Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Google App Engine data types

    Hi,

    I'm trying to write a roo script that will eventually generate my entities for a Google App engine application. I'm trying to define some of the types based on Google types.

    I tried using

    Code:
    field set --fieldName friendList --type com.google.appengine.api.datastore.Key
    but Roo wants the class to be added first. I get the following error:

    Code:
    field set --fieldName friendList --type com.google.appengine.api.datastore.Key
    The specified target '--type' does not exist or can not be found. Please create this type first.
    I also am trying to use Text data types, like the following.

    Code:
    field other --fieldName comment --type com.google.appengine.api.datastore.Text
    Can I use the Google types for my datatypes? Am I misunderstanding what the --type is for? Is there any examples of a roo script using data types other than the basic ones?

    Thanks
    Deege

  • #2
    OK, here's what I figured out on my own. Hopefully this will help someone else. I did see one similar post, with the same *crickets* response...

    This looks to be a misunderstanding of how "field set" works. Set looks to be only for one-many relationships, not collections. So you can't use set to create a list or collection of objects for gae multivalued properties.

    To get around this for generation I used

    Code:
    field other --type java.util.List --fieldName friendList
    Unfortunately you cannot specify the type of the list, so I suspect I'll have to go back and edit the classes generated later to use the correct type. I'm hoping that will work for one-many unowned relationships.

    You can use the Key type to create one-one unowned relationships (at least it generated, we'll see if it works) as so

    Code:
    field other --fieldName discoveredBy --type com.google.appengine.api.datastore.Key
    The report that it didn't work in my previous post seems to be incorrect. Not sure what changed. I only figured it out because I forgot to edit one, and I noticed it was working.

    Comment

    Working...
    X