Take advantage from entities spring
margar125 Aug 24, 2009 3:19 PMHi everyone;
I have developed a seam application, which works correctly.
Now, I have other project, which was developed in spring, it has connection to database, entities mapped by xml files in hibernate 2. In this way, I need to take advantage from these entities and mappings.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-// SPRING//DTD BEAN//EN" "http://www. Springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"><value>${db.driver}</value></property>
<property name="url"><value>${db.url}</value></property>
<property name="username"><value>${db.username}</value></property>
<property name="password"><value>${db.password}</value></property>
</bean>
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="myDataSource"/>
</property>
<property name="schemaUpdate"><value>${db.update}</value></property>
<property name="mappingResources">
<list>
<value>uy/com/geocom/geopos/sale/amount/Currency.hbm.xml</value>
<value>uy/com/geocom/geopos/sale/amount/DefaultRounderImpl.hbm.xml</value>
<value>uy/com/geocom/geopos/sale/item/Article.hbm.xml</value>
<value>uy/com/geocom/geopos/sale/item/Measure.hbm.xml</value>
<value>uy/com/geocom/geopos/sale/item/Category.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${db.hibernate.dialect}</prop>
<prop key="hibernate.connection.pool_size">1</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.c3p0.max_size">3</prop>
<prop key="hibernate.c3p0.min_size">1</prop>
<prop key="hibernate.c3p0.timeout">5000</prop>
<prop key="hibernate.c3p0.max_statements">100</prop>
<prop key="statement_cache.size">25</prop>
<prop key="show_sql">false</prop>
<prop key="jdbc.batch_size">0</prop>
<prop key="jdbc.use_streams_for_binary">true</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">false</prop>
</props>
</property>
</bean>
</beans>
I don't know how to begin!, how to integrate both projects.
Thanks you very much
I have developed a seam application, which works correctly.
Now, I have other project, which was developed in spring, it has connection to database, entities mapped by xml files in hibernate 2. In this way, I need to take advantage from these entities and mappings.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-// SPRING//DTD BEAN//EN" "http://www. Springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"><value>${db.driver}</value></property>
<property name="url"><value>${db.url}</value></property>
<property name="username"><value>${db.username}</value></property>
<property name="password"><value>${db.password}</value></property>
</bean>
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="myDataSource"/>
</property>
<property name="schemaUpdate"><value>${db.update}</value></property>
<property name="mappingResources">
<list>
<value>uy/com/geocom/geopos/sale/amount/Currency.hbm.xml</value>
<value>uy/com/geocom/geopos/sale/amount/DefaultRounderImpl.hbm.xml</value>
<value>uy/com/geocom/geopos/sale/item/Article.hbm.xml</value>
<value>uy/com/geocom/geopos/sale/item/Measure.hbm.xml</value>
<value>uy/com/geocom/geopos/sale/item/Category.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${db.hibernate.dialect}</prop>
<prop key="hibernate.connection.pool_size">1</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.c3p0.max_size">3</prop>
<prop key="hibernate.c3p0.min_size">1</prop>
<prop key="hibernate.c3p0.timeout">5000</prop>
<prop key="hibernate.c3p0.max_statements">100</prop>
<prop key="statement_cache.size">25</prop>
<prop key="show_sql">false</prop>
<prop key="jdbc.batch_size">0</prop>
<prop key="jdbc.use_streams_for_binary">true</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">false</prop>
</props>
</property>
</bean>
</beans>
I don't know how to begin!, how to integrate both projects.
Thanks you very much