Java 删除AppEngine上的实体时出错
我在尝试从数据库中删除实体时遇到一些问题。我有一个从业务对象中抽象AppEngine实体的接口。我可以轻松地插入和更新,但当我尝试删除时,出现了错误: java.lang.UnsupportedOperationException:非拥有的关系是 当前不受支持 org.datanucleus.store.appengine.datastorefkliststorespecification.clearWit houtdeletedatastorefkliststorespecification.java: 123 位于org.datanucleus.sco.backed.List.clearList.java:817 在 org.datanucleus.store.mapped.mapping.CollectionMapping.preDeleteCollection mapping.java: 299 在 org.datanucleus.store.appengine.DependentDeleteRequest.executependentdel eteRequest.java: 71 ... 我得到了接口Java 删除AppEngine上的实体时出错,java,google-app-engine,datanucleus,Java,Google App Engine,Datanucleus,我在尝试从数据库中删除实体时遇到一些问题。我有一个从业务对象中抽象AppEngine实体的接口。我可以轻松地插入和更新,但当我尝试删除时,出现了错误: java.lang.UnsupportedOperationException:非拥有的关系是 当前不受支持 org.datanucleus.store.appengine.datastorefkliststorespecification.clearWit houtdeletedatastorefkliststorespecification.
public interface ICompany extends IEntityBean {
// Getters
public List<IUser> getUsers();
public List<IDepartment> getDepartments();
public ICurrency getCurrency() throws Exception;
}
我没有任何依赖对象,我刚刚创建了一个公司,现在我正试图删除它。我假设映射是正确的,因为我可以在
公司但不是移除!
我做错什么了吗 解决了
我刚刚将GoogleJDO/JPA的版本更新为2.0,效果很好 解决了
我刚刚将GoogleJDO/JPA的版本更新为2.0,效果很好 当有v2.0可用时,为什么要使用Google JDO/JPA插件的v1.0?当有v2.0可用时,为什么要使用Google JDO/JPA插件的v1.0?
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;
}
}
// Get the entity manager
EntityManager em = this.getDBManager();
IEntityBean persistent = em.find(obj.getClass(), obj.getId());
em.remove(persistent);
em.flush();