0 Replies Latest reply on Oct 29, 2007 6:39 PM by Yuriy ZUbarev

    JAR with entities in a WebApp

    Yuriy ZUbarev Newbie


      I started a thread in JBoss Seam forum and then I was directed here: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=121137.

      To summarize, we have Maven managed projects and one project called "entity" only has entity classes in it with JPA annotations. A JAR generated from this project is then used/shared in couple of other projects. The problem here is that "entity".jar contains "persistence.xml" with declarations like these:

       <property name="hibernate.hbm2ddl.auto" value="validate" />
       <property name="hibernate.show_sql" value="true" />
       <property name="hibernate.cache.provider_class"
       value="org.hibernate.cache.HashtableCacheProvider" />

      But what if we want to use different value for "hibernate.hbm2ddl.auto" when we use "entity".jar in one application (web app A) and yet another value in web app B? I don't think there are ways to override values specified in "entity".jar from an application that is using it, is it correct?

      The other question I have is about project organization. Does anyone have a project that only builds JAR with entities and other project using it. Is it a good way to go about organization and code re-use?

      Thank you,