我使用 eclipselink 作为 JPA 提供程序,并且需要将实体保存在 jar 文件中。所有 jar 实体都用 @Entity 进行注释。我尝试了 false 和 true 但它没有自动检测实体。我不想在 persistence.xml 中编写所有类。请建议。
最佳答案
预计它不能在 Java SE 环境中工作。在 JPA 2.0 规范中,这是用以下文字来说明的:
To insure the portability of a Java SE application, it is necessary to explicitly list the managed persistence classes that are included in the persistence unit using the class element ofthe persistence.xml file.
关于java - <exclude-unlisted-classes>false</exclude-unlisted-classes> 在 SE 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18874956/