spring mvc +ibatis 怎样配置自动加载多个sqlmap.xml文件
1个回答
展开全部
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="typeAliasesPackage" value="com.xx.entity"/>
<property name="mapperLocations" value="classpath:mybatis/mapper/**/*Mapper.xml"/>
<property name="configLocation" value="classpath:mybatis/config/mybatis-config.xml"/>
<property name="plugins">
<array>
<bean class="com.github.pagehelper.PageHelper">
<property name="properties">
<value>
dialect=mysql
</value>
</property>
</bean>
</array>
</property>
</bean>
mapperLocations是mapper的存放路径
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询