Hi!
I am trying to model the following relationship
@PersistenceCapable
public class A{
@Persistent
@PrimaryKey
private String pk;
@Persistent(defaultFetchGroup = "true")
@Element(dependent = "true")
public LinkedList<B> container;
}
@PersistenceCapable
public class B {}
And finally, i have a C entity. This is an unowned realtionship because it
is associated with a B, but not all Bs have a C entity associated.
So, i modeled like this:
public class C{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key pk;
@Persistent
private Key keyOfB;
@Persistent
@Extension(vendorName="datanucleus", key="gae.parent-pk", value="true")
//key="gae.parent-pk" - the root entity for this entity
private Key keyOfA;
}
My problem is the following:
The ancestor of C should be B. However, if i erase the keyOfA field and put
the extension anotation in keyOfB, when updating a B entity and creating a C
entity in the same transaction, i will get a exception saying that the A
entity and B entity cannot be updatee because they are not in the same
entityt group!
Is this the wrong key? Am i doing something wrong? Any help would be great!
Note: it is necessary that the C entity is not an entity group root, as it
needs to be in the same transaction as B.
Thanks in advance
--
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.