|
|
@@ -34,7 +34,7 @@
|
|
|
<property name="timeBetweenEvictionRunsMillis" value="60000" />
|
|
|
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
|
|
|
<property name="minEvictableIdleTimeMillis" value="300000" />
|
|
|
- <!-- -->
|
|
|
+ <!-- 校验语句 -->
|
|
|
<property name="validationQuery" value="SELECT 1" />
|
|
|
<property name="testWhileIdle" value="true" />
|
|
|
<property name="testOnBorrow" value="false" />
|
|
|
@@ -47,11 +47,11 @@
|
|
|
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
|
|
|
<property name="dataSource" ref="dataSource" />
|
|
|
<property name="configLocation" value="classpath:mybatis-config.xml" />
|
|
|
- <property name="mapperLocations" value="classpath:com/zheng/cms/dao/mapper/*Mapper.xml" />
|
|
|
+ <property name="mapperLocations" value="classpath*:**/mapper/*Mapper.xml" />
|
|
|
</bean>
|
|
|
<!-- Mapper接口所在包名,Spring会自动查找其下的Mapper -->
|
|
|
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
|
|
|
- <property name="basePackage" value="com.zheng.cms.dao.mapper" />
|
|
|
+ <property name="basePackage" value="**.mapper" />
|
|
|
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
|
|
|
</bean>
|
|
|
|