我要遷移從Spring 2.5中我的項目到Spring 4.1
春天的舊版本和Hibernate在我的項目中使用的罐子:遷移距離Spring 2.5至4
春天2.5.6
彈簧webmvc 2.5.6
彈簧的Webflow 2.0.7.RELEASE
休眠的註解3.4.0.GA
冬眠-公地註解3.1.0.GA
冬眠核3.3.1.GA
冬眠ejb3-持久性1.0.2.GA
我想知道是否有方法可以找到與Spring兼容的Hibernate的最新版本,即4.1
其次,我想知道我應該在applicationContext.xml中進行哪些配置更改。 我的applicationContext看起來像這樣
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:jdbc.properties"/>
<property name="ignoreUnresolvablePlaceholders" value="true"/>
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${dataSource.driverClassName}"></property>
<property name="url" value="${dataSource.url}"></property>
<property name="username" value="${dataSource.username}"></property>
<property name="password" value="${dataSource.password}"></property>
<property name="initialSize" value="1"></property>
<property name="maxActive" value="10"></property>
<property name="maxIdle" value="14"></property>
<property name="minIdle" value="2"></property>
<property name="maxWait" value="15000"></property>
<property name="validationQuery" value="SELECT 1"></property>
<property name="minEvictableIdleTimeMillis" value="5000"></property>
<property name="testOnBorrow" value="true"></property>
<property name="testOnReturn" value="true"></property>
<property name="removeAbandoned" value="true"></property>
<property name="removeAbandonedTimeout" value="5"></property>
</bean>
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- Limit uploads to small (5KB) files for this sample -->
<property name="maxUploadSize" value="809000" />
</bean>
<!-- Default Connection -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation">
<value>/WEB-INF/hibernate.cfg.xml</value>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${dataSource.dialect}</prop>
<prop key="hibernate.default_batch_fetch_size">30</prop>
<prop key="hibernate.jdbc.fetch_size">20</prop>
<prop key="org.hibernate.cache">info</prop>
<prop key="org.hibernate.transaction">debug</prop>
<prop key="hibernate.jdbc.batch_size">100</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.use_sql_comments">true</prop>
<prop key="hibernate.max_fetch_depth">3</prop>
<prop key="hibernate.jdbc.batch_versioned_data">true</prop>
</props>
</property>
<property name="schemaUpdate" value="false" />
</bean>
<bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<tx:annotation-driven transaction-manager="txManager"/>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="baseService" abstract="true" lazy-init="true">
<property name="jdbcTemplate" ref="jdbcTemplate"/>
<property name="dataSource" ref="dataSource"/>
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
</beans>
,最後,我用的HibernateTemplate我的查詢。我可以在遷移後繼續使用它嗎?
非常感謝提前每個祕訣...
我會先遷移到3.2.9,然後遷移到4.x.兩個專業是一個很大的飛躍。 – soulcheck 2014-09-20 18:43:07