[jboss-user] [JBoss Tools] - Multiple JPA projects - one persistence.xml - can not be done?

jeff lowcock do-not-reply at jboss.com
Tue Jul 24 04:41:57 EDT 2012

jeff lowcock [https://community.jboss.org/people/aneh] created the discussion

"Multiple JPA projects - one persistence.xml - can not be done?"

To view the discussion, visit: https://community.jboss.org/message/749805#749805

To slightly expand the subject line.  I have multiple JPA projects all created via JBoss Tools in eclipse 3.7 (Indigo), each JPS has it's own persistence.xml file each with a unique persistence unit definition so there should be no conflicts between the jars..  The spec says that you may reference multiple jpa jars by using the <jar-file> element in persistence.xml.  So I have a problem, via the magic og JBoss Tools the location of the generated jar is unknown, although I am sure that someone out there can tell me where they are relative to either the workspace or the individual project.  However it I define the jar location as it is when deployed the development environment shows errors indicating that the imported JPA classes are not Entity(s).  That is they are not part of the JPA knowledge of the current project.
I know this is somewhat of an edge case but it is something I have wanted to do for a long time.  I have a large number of self contained subject areas(i.e. discrete JPA jars) previously I did not have the time to resolve this issue and simply copied the same JPA class into as many projects as I needed - bad practice.  Now I want to really have a nice modular solution where I can build once and include every where (not copy everywhere).
To offer a little more rationale I have a Person JPA, a Customer JPA , and a Supplier JPA project.  Currently I have to copy all of the files into a single JPA project to create a solution.  Not so bad you say!  If you only have a single client you are right.  However I have a number of clients all have these 3 JPA classes in common.  So to reduce the copy and paste activities whenever an update is made I would like to find a solution for my problem.

Reply to this message by going to Community

Start a new discussion in JBoss Tools at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120724/3e9c81bc/attachment-0001.html 

More information about the jboss-user mailing list