[ I got this directly, and I'm responding back to the
  list, so I've removed the sender's contact details.
  Thanks! ]

I'm not sure I understand. Parent.child is set properly
when I persist Parent, and persisting Parent persists its
Children (they are indeed in the data store, it's
just that the parent field of each Child is always null).
In addition to calling makePersistent on Parent,
I also need to call makePersistentAll on Parent.children?

-ian

> I beleive, you might need to explictly set the parent in child by calling
> setParent in child and call makePersistentAll. Since the ID is set, it maps
> accordingly and maintains consistency.
>
> 2010/11/5 Ian Murdock <[email protected]>
>>
>> On Fri, Nov 5, 2010 at 12:14 PM, Ian Murdock <[email protected]>
>> wrote:
>> >   �...@persistencecapable
>> >    public class Child {
>> >       �...@persistent
>> >        private Parent parent;
>> >       �...@persistent
>> >        private String field;
>> >
>> >        public Child(String field) {
>> >            this.field = field;
>> >        }
>> >
>> >        public Parent getParent() {
>> >            return parent;
>> >        }
>> >
>> >        public void setParent(Parent parent) {
>> >            this.parent = parent;
>> >        }
>> >    }
>>
>> Cut and paste error.. Child has a key too:
>>
>>   �...@persistencecapable
>>    public class Child() {
>>       �...@primarykey
>>       �...@persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
>>       �...@extension(vendorName="datanucleus", key="gae.encoded-pk",
>> value="true")
>>        private String key;
>>
>>        // ...
>>    }
>>
>> -ian
>> --
>> Ian Murdock
>> http://ianmurdock.com/
>>
>> "Don't look back--something might be gaining on you." --Satchel Paige
>>
>> --
>> 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.
>>

-- 
Ian Murdock
http://ianmurdock.com/

"Don't look back--something might be gaining on you." --Satchel Paige

-- 
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.

Reply via email to