0

Im using hibernate for establish connection with database. I found in web property for persistence.xml:

property name="hibernate.archive.autodetection" value="class"

It works fine when entities are in the same project with persistence.xml. But in my architecture i have another project for entities. I linked this two projects in my .pom file. And here is the problem. Entities are not detected by hibernate. There is any way to work around?

Technology stack of my project:
java se 8
maven
hibernate
pesistance

Bogus
  • 283
  • 1
  • 2
  • 13

2 Answers2

1

Regarding this post Is it possible to scan Entities in jar files using JPA and hibernate you need to explicitly list the entities or you scan the classpath yourself and register the entities programmatically.

0

I found a way around. Helped me jar-file tag. When I added it before properties tag then entities has been loaded. Still problem is that it need to be absolute path but, one problem is solved.

Bogus
  • 283
  • 1
  • 2
  • 13