Object NoteChain is the parent.
Object Note is the child.
They should be saved in on transaction, so they should be in one
entity group.
How to create the key for them? Here is my code but get the weird
error.
noteChain.key = KeyFactory.createKey("NoteChain", 1L)
noteChain.save()
println noteChain.key
note.key = noteChain.key.getChild("Note", 111L)
println note.key
note.save()
The error is
Detected attempt to establish NoteChain(1)/Note(111) as the parent of
NoteChain(1) but the entity identified by NoteChain(1) has already
been persisted without a parent. A parent cannot be established or
changed once an object has been persisted.
What is wrong? Anyway to create the key automatically?
I am using grails -> appEngine.
Thanks,
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" 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-appengine-java?hl=en.