Hi all,
I'm facing some problems trying to remove an entity from the database.
I have an interface to abstract the AppEngine Entity from my business
Object. I can easily Insert and Update, but when I try to delete I got
the error:
java.lang.UnsupportedOperationException: Non-owned relationships are
not currently supported
at
org.datanucleus.store.appengine.DatastoreFKListStoreSpecialization.clearWithoutDelete(DatastoreFKListStoreSpecialization.java:
123)
at org.datanucleus.sco.backed.List.clear(List.java:817)
at
org.datanucleus.store.mapped.mapping.CollectionMapping.preDelete(CollectionMapping.java:
299)
at
org.datanucleus.store.appengine.DependentDeleteRequest.execute(DependentDeleteRequest.java:
71)
...
I got the interface :
public interface ICompany extends IEntityBean {
// Getters
public List<IUser> getUsers();
public List<IDepartment> getDepartments();
public ICurrency getCurrency() throws Exception;
}
And I got the implementation
public class GAECompany extends GAEEntityBean implements ICompany {
@Override
@OneToMany(mappedBy = "company")
public List<IUser> getUsers() {
return this.users;
}
@Override
@OneToMany(mappedBy = "company")
public List<IDepartment> getDepartments() {
return this.departments;
}
@Transient
public ICurrency getCurrency() throws Exception {
return this.currency;
}
}
The code I'm using to remove:
// Get the entity manager
EntityManager em = this.getDBManager();
// Find the object
IEntityBean persistent = em.find(obj.getClass(), obj.getId());
// Remove it
em.remove(persistent);
em.flush();
I don't have any dependent objects I've just created an Company and
I'm trying to delete it
I assumed the mapping is right cause I'm able to INSERT an UPDATE the
company. but not REMOVE!
Am I doing something wrong??
Tks guys!
--
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.