Hi All. Mi name in Miguel and I'm getting a kind of trouble about modeling data objects to the google data store. Right now I have a data model to be saved in the datastore, I need cover next requirements, but I really don't know to to handle this.
I have a data model wich entities have other entities as children and those children has references to their "brothers" (different kind of childrens owned by the same parent). In the data model, the parent- child relationship is modeled by an owned relationship (see link bellow) and the child-child is an unowned relationship. (referencing the Key id of the brother). to this point there is no problem (at least that's what I think) but my problem comes when I try to reference two children each other before have being saved in the datastore. http://code.google.com/intl/es-ES/appengine/docs/java/datastore/jdo/relationships.html#Owned_One_to_Many_Relationships I mean, I can create a parent (with id null), some children (each one with id null), untill here, there is no problem because each parent knows its children though their ids are null, but here (before sending it to data store) I have to reference a child from another one (somethig as child.setBigBrother(anotherChild.getId()), but in this case, the "anotherChild.getId()" is a null value. Actually I'have tried to popullate my ids before sending them to the datastore (creating with KeyFactory a key based on parent's key) and it works like good, but, in some cases, I need to create children without parent to be added later to the parent (wich is imposible because the child's key creation needs the parent) I'm really consufed on how to solve this. I hope being clear enough, but if you are confused too, please, tell me and I'll try to make it more clear. Thanks a lot! -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
