This content has been marked as final.
Show 7 replies
-
1. Re: JAR with entities in a WebApp
pmuir Oct 12, 2007 4:40 PM (in response to yuriy_zubarev)What is the structure of the archives when deployed?
-
2. Re: JAR with entities in a WebApp
yuriy_zubarev Oct 12, 2007 4:49 PM (in response to yuriy_zubarev)It looks like this:
webapp |-- META-INF | |-- persistence.xml | |-- context.xml |-- WEB-INF |-- web.xml |-- components.xml |-- pages.xml |-- classes | |-- seam.properties | |-- webpackage | |-- BookController.class |-- lib |-- entity.jar
Thank you,
Yuriy -
3. Re: JAR with entities in a WebApp
yuriy_zubarev Oct 12, 2007 4:50 PM (in response to yuriy_zubarev)entity.jar is under lib folder of course.
-
4. Re: JAR with entities in a WebApp
pmuir Oct 12, 2007 5:17 PM (in response to yuriy_zubarev)Surely persistence.xml should be in the entity jar?
-
5. Re: JAR with entities in a WebApp
yuriy_zubarev Oct 12, 2007 5:26 PM (in response to yuriy_zubarev)Ok I got it. I had persistence.xml both in entity.jar and under META-INF of the webapp. As soon as I removed it from webapp the app started working.
Thank you,
Yuriy -
6. Re: JAR with entities in a WebApp
yuriy_zubarev Oct 12, 2007 5:35 PM (in response to yuriy_zubarev)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 -
7. Re: JAR with entities in a WebApp
pmuir Oct 12, 2007 5:44 PM (in response to yuriy_zubarev)You should ask this question in the hibernate jpa forum.