spring-mybatis.xml 1.6 KB

123456789101112131415161718192021222324252627282930
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:context="http://www.springframework.org/schema/context"
  4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
  5. xmlns:aop="http://www.springframework.org/schema/aop" xmlns:mvc="http://www.springframework.org/schema/mvc"
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans
  7. http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
  8. http://www.springframework.org/schema/context
  9. http://www.springframework.org/schema/context/spring-context-3.1.xsd
  10. http://www.springframework.org/schema/aop
  11. http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
  12. http://www.springframework.org/schema/mvc
  13. http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">
  14. <!-- <import resource="classpath*:/spring/jdbc-datasource-oracle.xml" />
  15. <import resource="classpath*:/spring/jdbc-datasource-sqlserver.xml" />
  16. -->
  17. <import resource="classpath*:/spring/jdbc-datasource-mysql.xml" />
  18. <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  19. <property name="dataSource" ref="dataSource" />
  20. <property name="configLocation" value="classpath:mybatis/mybatis-config.xml" />
  21. <property name="mapperLocations" value="classpath*:/mybatis/mapper/*/*.xml"/>
  22. </bean>
  23. <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
  24. <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
  25. <property name="basePackage" value="com.ssm.mapper" />
  26. </bean>
  27. </beans>