-->
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.  [ 2 posts ] 
Author Message
 Post subject: hibernate hibernate.hbm2ddl.auto issues
PostPosted: Tue Apr 20, 2010 1:49 pm 
Newbie

Joined: Tue Feb 09, 2010 6:06 am
Posts: 3
I have two perssitence.xmls that belongs to two databases
-----------------first persietnce.xml------------
tables --A,B,C

--------second persistence.xml-------------------
tables X,Y,Z

I have main application-context in my service layer where I am importing above business layers xml as below:
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceXmlLocation" value="classpath*:test/merlin-persistence.xml"/>
<!-- <property name="persistenceUnitManager" ref="persistenceUnitManager"/> -->
<property name="persistenceUnitName" value="MerlinPU" />
<property name="dataSource" ref="dataSource"/>
<property name="jpaPropertyMap">
<map>
<entry key="hibernate.format_sql" value="true" />
<entry key="hibernate.hbm2ddl.auto" value="update" />
</map>
</property>
<property name="jpaDialect">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaDialect"/>
</property>
</bean>

<!-- Define the EntityManagerFactory -->
<bean id="geoentityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<!-- <property name="persistenceUnitManager" ref="geopersistenceUnitManager"/> -->
<property name="persistenceXmlLocation" value="classpath*:test1/geolocate-persistence.xml"/>
<property name="persistenceUnitName" value="GeolocatePU" />
<property name="dataSource" ref="geodataSource"/>
<property name="jpaPropertyMap">
<map>
<entry key="hibernate.format_sql" value="false" />
<entry key="hibernate.hbm2ddl.auto" value="update" />
</map>
</property>
<property name="jpaDialect">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaDialect"/>
</property>
</bean>
but when i start my tomcat server ,
two databses have all the tables A,B,C,X,Y,Z ..how can i generate databses only with respeective tables, am i doing anything wrong


Top
 Profile  
 
 Post subject: Re: hibernate hibernate.hbm2ddl.auto issues
PostPosted: Tue Apr 20, 2010 3:20 pm 
Newbie

Joined: Tue Feb 09, 2010 6:06 am
Posts: 3
when i tried to run localling using main method in java and tried to call applicationcontext tables are generated perfectly in two databases, but when i tried to run the same in tomcat, the tables are mixed in both databses, am i doing anything wrong or do i have to set anything on tomcat server please suggest


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.