1

as you can see in this tutorial http://www.vogella.com/tutorials/JavaPersistenceAPI/article.html when you declare an entity like Person then you must add it in persistence.xml likes <class>de.vogella.jpa.eclipselink.model.Person</class> or you can define a mapping file and put your classes in there, but when you use hibernate as you can see here http://www.alexecollins.com/tutorial-hibernate-jpa-part-1/ after entity declaration you don't need to add anything in persistence.xml as class. or maybe I misundrestood.

I want eclipe link does the same way that hibernate does, means I should use eclipse link and I don,t want to declare class or use any mapping file, does it possible or it doesn't?

thanks

AKZ
  • 856
  • 2
  • 12
  • 30

1 Answers1

0

You wanted to ignore <class> annotation from persistence.xml & you wanted your eclipse to auto detect annotated class files right? Then try the following,

Right click on the project, click Properties, select JPA, in the Persistence class management select Discover annotated classes automatically.

enter image description here

Referred link: Do I need <class> elements in persistence.xml?

Community
  • 1
  • 1
svjn
  • 904
  • 2
  • 19
  • 35