문제

We have some JPA entity classes which are currently under development and wouldn't want them as part of the testing cycle. We tried commenting out the relevant entity classes in META-INF\persistence.xml but the hbm2ddl reverse engineering tool still seems to generate SQL for those entities. How do I tell my code to ignore these classes? Are there any annotations for these or should I have to comment out the @Entity annotation along with my changes in persistence.xml file.

도움이 되었습니까?

해결책

JPA automatically scans your classpath for entities. So one option, as you say, is to remove the @Entity annotation. Another option is to use <exclude-unlisted-classes>true</exclude-unlisted-classes> which will cause only the listed classes in persistence.xml to be used.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top