AppEngineDatanucleusJPA在实体的集合属性上抛出javax.persistence.PersistenceException
创始人
2024-09-10 05:30:53
0

您可以通过配置Datanucleus属性来解决此问题。在persistence.xml文件中添加以下内容:

此外,如果您使用使用嵌套实体集合,则需要将“datanucleus.appengine.datanucleus.DirectMetaDataSynchronizedWithBackingStore”属性设置为“false”。

@Entity public class Parent{

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Key id;

@ElementCollection(fetch = FetchType.EAGER)
private List children = new ArrayList<>();

public Key getId() {
    return id;
}

public void setId(Key id) {
    this.id = id;
}

public List getChildren() {
    return children;
}

public void setChildren(List children) {
    this.children = children;
}

}

@Entity public class Child {

private String name;

public Child() {}

public Child(String name) {
    this.name = name;
}

public String getName() {
    return name;
}

public void setName(String name) {
    this.name = name;
}

}

请注意,在使用嵌套实体集合时,Child实体必须拥有无参构造函数。

相关内容

热门资讯

透视透视!wepoker辅助工... 透视透视!wepoker辅助工具,哈糖大菠萝有挂吗5个常用方法,透明挂教程(切实真的是有挂)1、玩家...
透视app!wpk透视脚本链接... 透视app!wpk透视脚本链接,aapoker透视插件,可靠教程(往昔存在有挂)1、点击下载安装,微...
透视教学!智星德州菠萝透视插件... 透视教学!智星德州菠萝透视插件工具,hhpoker开挂教程,第三方教程(起初是真的有挂)1、完成智星...
透视安卓版!智星菠萝辅助,如何... 透视安卓版!智星菠萝辅助,如何下载wpk透视版,新版2025教程(真是存在有挂),亲,有的,ai轻松...
透视新版!wepoker透视脚... 透视新版!wepoker透视脚本下载,wepoker透视app下载,透明挂教程(一向是真的有挂);人...
透视肯定!aapoker辅助插... 《透视肯定!aapoker辅助插件工具,wpk辅助哪里买,德州教程(从前真的有挂)》 aapoker...
透视计算!德普之星辅助器app... 透视计算!德普之星辅助器app,wepoker透视脚本是什么,攻略教程(原生有挂);是一款可以让一直...
透视有挂!hhpoker辅助软... 透视有挂!hhpoker辅助软件下载,约局吧辅助器,详细教程(最初是真的有挂);原来确实真的有挂(需...
透视好友房!wpk辅助工具,h... 透视好友房!wpk辅助工具,hhpoker开挂教程,安装教程(好像真的是有挂)是一款可以让一直输的玩...
透视存在!红龙poker脚本,... 红龙poker脚本新手教程相关信息汇总(需添加指定Q群1067239143获取下载链接);透视存在!...