I often Hibernate or EclipseLink mapping bugs and I frequently need to package JavaSE standalone apps with JPA.
How do I add the JPA validator to my JavaSE projects? Converting the project to faceted and then checking "JPA" under "Project Facets" gives me an error "JPA 2.0 requires any member of "JPA prerequisite facets" group" and disables the OK button. I then must select "Dynamic web module" to make it work, but this adds a lot of unneeded setup to the project.
Can it be done without selecting "Dynamic web module", which effectively the project isn't?
In Helios, Dali still required a Java EE facet for JPA functionality. In Indigo, this will no longer be the case.
But you may find that adding the Utility Module facet may be acceptable. Yes, your project is not technically intended for usage as a utility jar in a JEE application, but there are not many differences between such a jar and an SE application.
As Paul mentioned, you just need to add the Utility facet to the project as well. This shouldn't impact your Java SE project code in any way and is just an facet that Dali needs to correctly handle certain functionality pre-Indigo.
The easy way to convert from a Java to Java + JPA project is to use the "Configure" menu by right-clicking the Java project you wish to convert. There will be an option for converting to a JPA project. This will ensure the correct Java SE configuration. That said, adding the Utility facet to your project will result in the same configuration. No Web Project facets are required.
BTW: When pressing the "Convert to JPA Project..." button and hitting "Cancel" in the next dialog won't cancel the conversion. The project has been converted to faceted already. Pressing this menu item accidentally has non-undoable effects.
Yes, unfortunately it does. The first part is effectively the same as selecting "Convert to faceted form" under the "Project Facets" node in the project properties. We haven't found a very good solution for reverting this.