[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - JAR with entities in a WebApp

yuriy_zubarev do-not-reply at jboss.com
Mon Oct 29 18:39:55 EDT 2007


Greetings,

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:


  | <properties>
  | 			<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" />
  | 		</properties>
  | 

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,
Yuriy


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4100031#4100031

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4100031



More information about the jboss-user mailing list