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
|