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

  • Google App Engine data types


    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

    field set --fieldName friendList --type
    but Roo wants the class to be added first. I get the following error:

    field set --fieldName friendList --type
    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.

    field other --fieldName comment --type
    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?


  • #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

    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

    field other --fieldName discoveredBy --type
    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.