Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eclipse existing maven project add jpa support?

how to add jpa support for existing maven project

i tried

project-->configure--> convert to jpa project (there is no this option)

but for my other projects, such option available... can comment?

I already have existing mven project and i want to generate jpa entity from tables. no need to create new jpa project right?

like image 844
cometta Avatar asked Dec 25 '09 06:12

cometta


2 Answers

I'm not sure but I think that you need to setup your project to use the JPA Facet (right click on the project the Properties > Project Facets and select Java Persistence). I don't know if m2eclipse can add this facet automatically.

But actually, with the version of Eclipse I'm using, adding the JPA facet doesn't add any entry for JPA under Configure when I right click on a project. It adds a menu JPA Tools > Generate Entities from Tables... (and JPA Tools > Generate Tables from Entities...).

like image 163
Pascal Thivent Avatar answered Sep 24 '22 20:09

Pascal Thivent


Be sure to coordinate your Maven dependencies with the Eclipse JPA configuration. By default, Eclipse uses EclipseLink as its JPA implementation, which would require the use of a specific repository location and set of dependencies for the associated components in your project POM. If you choose to use EclipseLink rather than another JPA user library, ensure that the version numbers are consistent between the Eclipse and Maven configuration settings. More information on Eclipse and Maven/Eclipse configuration can be found at: http://www.eclipse.org/eclipselink/downloads/.

Use the 'EclipseLink P2 Repository' info to set up your workbench EclipseLink version and libraries, and follow the 'EclipseLink Maven Repository' link to set up your project POM to match it.

like image 44
Roby Gamboa Avatar answered Sep 24 '22 20:09

Roby Gamboa