Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse + Turn an Existing Project into a JPA Project

Is there a way to turn a normal Eclipse Project into a JPA Project?

I have a normal project with Entities in it and a Persistence.xml file, but it is not an eclipse recognized JPA project. What can I do?

like image 915
mainstringargs Avatar asked Mar 31 '09 21:03

mainstringargs


People also ask

Is JPA and Java project same?

The Java Persistence API, sometimes referred to as JPA, is a Java programming language specification which describes the management of relational data in applications using Java Platform, Standard Edition and Java Platform, Enterprise Edition.


3 Answers

project properties --> project facets. There you can click on the JPA check-box and you have an JPA project.

like image 60
Mark Baijens Avatar answered Oct 16 '22 22:10

Mark Baijens


You could also Right Click the eclipse project and click on configure which allows you to convert to a JPA project.

alt text

like image 29
Eric Warriner Avatar answered Oct 16 '22 23:10

Eric Warriner


You'll want to modify:

  • your .project
  • your .classpath (eventually)
  • your .settings if you're unlucky

As Chris Nava said, the best way to do that is to create an empty JPA project and compare it with yours.

I found it is sometimes necessary to delete your original project (do not "delete project content on disk" !) and reimport it to make Eclipse happy.

like image 43
ptyx Avatar answered Oct 16 '22 23:10

ptyx