Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » Add JPA validator to JavaSE project
Add JPA validator to JavaSE project [message #667365] Thu, 28 April 2011 11:17 Go to next message
Karsten Wutzke is currently offline Karsten Wutzke
Messages: 112
Registered: July 2009
Senior Member
Hello,

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?

Karsten
Re: Add JPA validator to JavaSE project [message #667411 is a reply to message #667365] Thu, 28 April 2011 15:04 Go to previous messageGo to next message
Paul Fullbright is currently offline Paul Fullbright
Messages: 200
Registered: July 2009
Senior Member
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.

Or perhaps you could wait for Indigo.
Re: Add JPA validator to JavaSE project [message #667429 is a reply to message #667365] Thu, 28 April 2011 16:30 Go to previous messageGo to next message
Neil Hauge is currently offline Neil Hauge
Messages: 470
Registered: July 2009
Senior Member
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.

Neil
icon14.gif  Re: Add JPA validator to JavaSE project [message #667511 is a reply to message #667365] Fri, 29 April 2011 09:38 Go to previous messageGo to next message
Karsten Wutzke is currently offline Karsten Wutzke
Messages: 112
Registered: July 2009
Senior Member
Thanks, this worked.

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.

Karsten

[Updated on: Fri, 29 April 2011 09:39]

Report message to a moderator

Re: Add JPA validator to JavaSE project [message #671057 is a reply to message #667511] Mon, 16 May 2011 16:08 Go to previous message
Paul Fullbright is currently offline Paul Fullbright
Messages: 200
Registered: July 2009
Senior Member
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.
Previous Topic:"Generate Table from Entities" and reserved words
Next Topic:JPA Tools -> Entity from Tables
Goto Forum:
  


Current Time: Fri Oct 31 13:04:31 GMT 2014

Powered by FUDForum. Page generated in 0.02526 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software