Closed GoogleCodeExporter closed 9 years ago
Did you save the field as non-parent, then are trying to change the field to
@Parent and load it?
You can't do that. @Parent is part of the identity of an entity; changing the
@Parent references a new and different entity. Read this:
https://code.google.com/p/objectify-appengine/wiki/Concepts#Keys
Closing as Invalid. If I have misunderstood the issue, please clarify and I
will reopen. If you would like to start a discussion, please use the Google
Group (linked at the google code home page for Objectify).
Original comment by lhori...@gmail.com
on 21 Jun 2013 at 2:01
No that is not the problem. I do not use old data. Let me be more clear:
fooRef.get()returns null when Foo has a @Parent attribute (and a parent). But
then perform the same test… from scratch with new data (without a parent) and
you get the foo instance.
It looks like this is the same problem:
http://stackoverflow.com/questions/12951766/ref-get-does-not-work-if-comes-from-
a-just-loaded-listref
Original comment by jens.sch...@gmail.com
on 24 Jun 2013 at 10:14
I ran across this report while trying to debug similar symptoms. If anyone else
reads this post, the following may be helpful.
Symptoms: class A holds a reference to class B and class B has a parent of
class A. When I removed the @Parent from the parent key field in class B, the
reference would return the correct value. Otherwise, it would return null.
Problem: I had created the reference using a manual key. That key did not
consider the parent relationship.
It working when I removed the @Parent was a red herring
Solution: I just generated the reference with Ref.create( instanceOfObject )
Original comment by ste...@lightningrodgames.com
on 5 Oct 2013 at 9:13
Original issue reported on code.google.com by
jens.sch...@gmail.com
on 21 Jun 2013 at 12:32