未找到使用 OpenJPA 和 RuntimeUnenhancedClasses 的类型的元数据

发布于 2024-09-29 06:37:20 字数 1634 浏览 4 评论 0原文

我正在使用 JPA (OpenJPA)。我的 persistence.xml 中有以下条目:

<property name="openjpa.RuntimeUnenhancedClasses" value="supported"/>

我还在 persistence.xml 中列出了 Serviceoffering 类。 当我尝试运行与 JPA 相关的代码时,出现以下异常。可能是什么问题?

No metadata was found for type "class com.XYZ.cloud.bss.client.db.data.Serviceoffering".  Ensure that the class is enhanced (if necessary), that the class has appropriate metadata, and that if you list your persistent classes, the class is included in your list.
C = null
<openjpa-1.2.1-SNAPSHOT-r422266:686069 fatal user error> org.apache.openjpa.persistence.ArgumentException: No metadata was found for type "class com.XYZ.cloud.bss.client.db.data.Serviceoffering".  Ensure that the class is enhanced (if necessary), that the class has appropriate metadata, and that if you list your persistent classes, the class is included in your list.
    at org.apache.openjpa.meta.MetaDataRepository.getImplementorMetaDatas(MetaDataRepository.java:1108)
    at org.apache.openjpa.kernel.QueryImpl.createExecutor(QueryImpl.java:720)
    at org.apache.openjpa.kernel.QueryImpl.compileForDataStore(QueryImpl.java:692)
    at org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:674)
    at org.apache.openjpa.kernel.QueryImpl.getOperation(QueryImpl.java:1492)
    at org.apache.openjpa.kernel.DelegatingQuery.getOperation(DelegatingQuery.java:123)
    at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:243)
    at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:293)
    at c

I am using JPA (OpenJPA). I have following entries in my persistence.xml:

<property name="openjpa.RuntimeUnenhancedClasses" value="supported"/>

I also have Serviceoffering class listed in persistence.xml.
I am getting following exception when I try to run my JPA-related code. What can be the problem?

No metadata was found for type "class com.XYZ.cloud.bss.client.db.data.Serviceoffering".  Ensure that the class is enhanced (if necessary), that the class has appropriate metadata, and that if you list your persistent classes, the class is included in your list.
C = null
<openjpa-1.2.1-SNAPSHOT-r422266:686069 fatal user error> org.apache.openjpa.persistence.ArgumentException: No metadata was found for type "class com.XYZ.cloud.bss.client.db.data.Serviceoffering".  Ensure that the class is enhanced (if necessary), that the class has appropriate metadata, and that if you list your persistent classes, the class is included in your list.
    at org.apache.openjpa.meta.MetaDataRepository.getImplementorMetaDatas(MetaDataRepository.java:1108)
    at org.apache.openjpa.kernel.QueryImpl.createExecutor(QueryImpl.java:720)
    at org.apache.openjpa.kernel.QueryImpl.compileForDataStore(QueryImpl.java:692)
    at org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:674)
    at org.apache.openjpa.kernel.QueryImpl.getOperation(QueryImpl.java:1492)
    at org.apache.openjpa.kernel.DelegatingQuery.getOperation(DelegatingQuery.java:123)
    at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:243)
    at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:293)
    at c

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

謸气贵蔟 2024-10-06 06:37:20

com.XYZ.cloud.bss.client.db.data.Serviceoffering 添加到 persistence.xml 文件,并确保类 Serviceoffering 已由 JVM 预先加载执行您的查询。

现在我强烈建议您不要设置。是的,有一些支持,但它会给你带来很多麻烦。浏览一下我很久以前写的博客文章增强过程......应该会让你滚动。

Add <class>com.XYZ.cloud.bss.client.db.data.Serviceoffering</class> to your persistence.xml file and make sure that the class Serviceoffering is loaded by the JVM prior to executing your query.

Now I'm going to highly recommend that you don't set <property name="openjpa.RuntimeUnenhancedClasses" value="supported"/>. Yes some support is there, but it's going to give you a lot of headaches. Take a peek through a blog post I wrote a long time back talking about the enhancement process.... that should get you rolling.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文