In case my subject line was confusing, I'll elaborate:

Let's say I have a parent object that has a collection of children.  I
detach that parent object and intentionally omit the collection of
children from the fetch group, in order to avoid fetching the
potentially numerous children.

Then, I want to add a new child to that parent's collection.  I
thought I would be able to add that child to the parent's empty un-
detached collection, and thus have a child-collection size of 1, and
then have that child be added to the parent's collection of children
when the parent is attached.  This code gave me an "illegal access of
field that wasn't detached, if you want to access this field please
detach it" exception.

The reason that I thought this was possible was the following lines
from the JDO docs:
"If you don't detach a field of an object, you cannot access the value
for that field while the object is detached.
If you don't detach a field of an object, you can update the value for
that field while detached, and thereafter you can access the value for
that field."
(http://www.jpox.org/docs/1_2/jdo/attach_detach.html)

The second line pertains to what I'm doing (updatingthe value for the
field while detached), but I guess in so doing I am also trying to
"access the value" for the field.

In short, is what I'm trying to do possible?

Cheers,
Mike

-- 
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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to