You might want to use @Persistent(mappedBy = "parent") for your Parent
entity declaration in your Child entity.

Owned one-to-many
http://code.google.com/appengine/docs/java/datastore/jdo/relationships.html#Owned_One_to_Many_Relationships

On Jun 5, 9:27 pm, Didier Durand <durand.did...@gmail.com> wrote:
> Hi,
>
> As a workaround, why don't you delete each entity in the set in a loop
> by yourself before deleting the entity which the set is part of ?
>
> regards
>
> didier
>
> On Jun 6, 1:48 am, mscwd01 <mscw...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hey,
>
> > I have a "parent" entity which has a Set of "child" entities, as
> > follows:
>
> > class Parent {
>
> > @Persistent @Element(dependent = "true")
> > private Set<Child> children;
>
> > }
>
> > When I delete the "Parent" entity I get the following exception:
>
> > javax.jdo.JDOUserException: Cannot read fields from a deleted object
> > FailedObject:com.google.appengine.api.datastore.Key:Parent("100034534545656 
> > 7676")/
> > Child(2)
>
> > It seems JDO deletes the "Parent" entity before the "Child" objects in
> > the dependent Set property, which causes the above exception to appear
> > when the Child entities in the Set are themselves deleted. Does anyone
> > know how to solve this issue?
>
> > FYI when I delete the parent entity I use pm.deletePersistent() within
> > a transaction.
>
> > 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 google-appengine-java@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