【发布时间】:2013-12-23 19:12:21
【问题描述】:
我使用 OpenJPA 作为 JPA 提供程序并尝试立即更新实体列表。但我得到以下错误。
Exception in thread "P=866223:O=0:CT" <openjpa-2.0.0-r422266:935683 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: No metadata was found for type "class java.util.ArrayList". The class is not enhanced.
我们为列表添加了注释,如下所示。
@ElementCollection
private List<Student> students = new ArrayList<Student>();
我们在persistence.xml中添加了以下部分
<property name="openjpa.MetaDataFactory" value="jpa(Types=java.util.ArrayList)"/>
谁能帮我解决这个问题?
【问题讨论】:
-
你能发布你试图坚持的实体的sn-ps吗?同时发布您的 persistence.xml 文件的内容。
标签: java jakarta-ee jpa openjpa