-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: JPA with mulitple jars
PostPosted: Sun Mar 04, 2007 6:10 pm 
Newbie

Joined: Mon Dec 12, 2005 6:00 pm
Posts: 11
I'm trying to build a series of modules that any web-app based on JPA can share. I have one jar that contains a base class for all of my domain objects (among other useful things). I have another jar file that contains things like users, groups and roles. I figure most web-apps will need these. Then I'd like the web apps themselves to be able to define their domain objects. I can get all of this working, but I'm not crazy about the configuration. I have to put each class, including those defined in the aforementioned jars in a <class> stanza in my persistence.xml. Is there any way around this? I can guarantee that every time I add a new domain object I will forget to put it in persistence.xml. This is the type of configuration I'd like to avoid by building these modules in the first place. Anyone have any suggestions?

-jeff


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 07, 2007 8:28 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
use <jar-file> to point to the appropriate jar, the entities will be discovered

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 23, 2008 9:38 pm 
Newbie

Joined: Wed Jan 23, 2008 9:11 pm
Posts: 2
emmanuel wrote:
use <jar-file> to point to the appropriate jar, the entities will be discovered


in a war, how to use a relative path in <jar-file>?


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 30, 2008 1:46 pm 
Newbie

Joined: Wed Oct 24, 2007 2:39 pm
Posts: 7
I have the same scenario.
I try this:
Code:
   <persistence-unit name="entityManager" transaction-type="JTA">
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <jta-data-source>jdbc/dbsm</jta-data-source>
<jar-file>MyEJBApp.jar</jar-file>
<jar-file>MyBaseJar.jar</jar-file>
      <properties>
         <property name="hibernate.ejb.cfgfile" value="/META-INF/hibernate.cfg.xml"/>
      </properties>
   </persistence-unit>


But didn't works :(
Any help ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.