• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Integrate multiple JPA projects

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi people,

I'm getting some trouble on the integration of two JPA projects.
This is my scenario:

I have a table EMPLOYEE with its entity class mapped into EmployeeJPAProject and a table ADDRESS mapped into AddressJPAProject (each project has its own persistence.xml).
There's another table EMPLOYEE_ADDRESS in the database, which hold information about the relationship between EMPLOYEE and ADDRESS.

In the entity class for EMPLOYEE, the Employee.java, I inserted the following annotation:


With the code stated as above, I'm getting an error message "Referenced column "ID_ADDR" in join column "ID_ADDR" cannot be resolved".
I suspect the error happend because the entity class for ADDRESS is declared in a project different from EmployeeJPAProject and therefore JPA wasn't able to find the ADDRESS entity declaration.
Does anyone can give me some hints about how to make these two projects working together without changing the project structure?

Thanks.
 
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe that the entities used in mappings have to be in the same persistence unit (the JPA term for your "project") and therefore, integration should include merging those two units.
 
reply
    Bookmark Topic Watch Topic
  • New Topic