Question

I have two Eclipse Maven Java projects. A domain project that is laden with JPA annotations and a persist project that implements DAOs for the domain objects. The persist project depends on the domain project. Maven compiles everything and it all Just Works.

My JPA persistence.xml file is located in the persist project however, and the Eclipse JPA (Dali) plugin thus works with the persist project, but for the domain project it complains that the project has no persistence.xml file. I'd really like to get the JPA Details and JPA structure views working in my domain project. Whats the best way to work around this?

I tried linking the META-INF folder from persist to domain, but that didn't work.

Was it helpful?

Solution 2

Move the persistence.xml to the domain module and just don't use Dali in the persist module.

Since persist depends on domain, the system builds and runs fine because JPA is able to locate the persistence.xml file in the domain JAR file without difficulty.

OTHER TIPS

  1. Right click on projects
  2. Click "project facets" on the left
  3. Check if JPA facet is checked
  4. After checking you will need to define the persistence.xml path I think alt text
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top