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.
+2
A:
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.
Petar Minchev
2010-06-16 10:49:46
thanks very much, you rock :)
Samuel
2010-06-16 11:53:29
Hah, thank you:)
Petar Minchev
2010-06-16 12:05:23