google-code-export / twig-persist

Automatically exported from code.google.com/p/twig-persist
1 stars 1 forks source link

Parent Child Relationships #57

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
The new jar does not seem to support the old way of storing
Parent/Child entities.

What is the expected output? What do you see instead?
ObjectDatastore o = getD();
        o.store(myMember);
        o.store(newUser, myMember);

What version of the product are you using? On what operating system?
The code above throws an error because o.store(newUser, myMember)
is not a valid method anymore

Please provide any additional information below.

Original issue reported on code.google.com by dafin...@gmail.com on 30 Jan 2011 at 4:04

GoogleCodeExporter commented 9 years ago
You are right. This was removed because people mistakenly thought the seconds 
parameter would be an Id object.

Instead use the more explicit:

datastore.store().instance(newUser).parent(myMember).now()

its a little longer but less error prone and more understandable to read.

Original comment by jdpatterson on 31 Jan 2011 at 12:10

GoogleCodeExporter commented 9 years ago

Original comment by jdpatterson on 13 Feb 2011 at 4:53