Say the owner has a collection of Watch (s).
I am trying to create Watches and add the created watches to the existing collection of owner watches (arraylist).
My method is as follows:
public void add(String ownerName, String watchName) { Owner o = new OwnerDAO().retrieve(ownerName);
The code works in the local GAE environment without problems, but posed the following problem when it is in the GAE online environment:
org.datanucleus.store.mapped.scostore.FKListStore$1 fetchFields: Object " package.Owner@2b6fc7 " has a collection "package.Owner.watches" yet element " package.Watch@dcc4e2 " doesnt have the owner set. Managing the relation and setting the owner org.datanucleus.store.mapped.scostore.FKListStore$1 fetchFields: Object " package.Owner@2b6fc7 " has a collection "package.Owner.watches" yet element " package.Watch@dcc4e2 " doesnt have the owner set. Managing the relation and setting the owner .
Can I find out how I can solve this problem? Thanks!
Objects:
Owner:
@id private String name; @OneToMany(mappedBy = "owner", targetEntity = Watch.class, cascade = CascadeType.ALL) private List<Watch> watches= new ArrayList<Watch>();
Clock:
@id private String name; @ManyToOne() private Owner owner;
Thank you in advance!
Best wishes,
Jason
Jason source share