[jboss-user] [JBoss Seam] - Re: JAR with entities in a WebApp

yuriy_zubarev do-not-reply at jboss.com
Fri Oct 12 17:35:26 EDT 2007


At the same time. This is not flexible enough. If entity.jar gets distributed everywhere with its own persistence.xml that looks something like this:


  | <?xml version="1.0" encoding="UTF-8"?>
  | <persistence xmlns="http://java.sun.com/xml/ns/persistence"
  | 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  | 	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
  | 	version="1.0">
  | 
  | 	<persistence-unit name="coolDatabase"
  | 		transaction-type="RESOURCE_LOCAL">
  | 		<provider>org.hibernate.ejb.HibernatePersistence</provider>
  | 		<jta-data-source>java:comp/env/jdbc/CoolDB</jta-data-source>
  | 		<class>entitypackage.Book</class>
  | 		<properties>
  | 			<property name="hibernate.hbm2ddl.auto" value="create-drop" />
  | 			<property name="hibernate.show_sql" value="true" />
  | 			<property name="hibernate.cache.provider_class"
  | 				value="org.hibernate.cache.HashtableCacheProvider" />
  | 		</properties>
  | 	</persistence-unit>
  | </persistence>
  | 

then every system would "inherit" and would have to respect names like "coolDatabase", hibernate.hbm2ddl.auto would always be set to true and so on.

What I would like is to keep my entities separately from rules on how they could be used. Is it possible somehow?

Thank you.
Yuriy


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

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



More information about the jboss-user mailing list