12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?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:jee="http://www.springframework.org/schema/jee"
- xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
- xmlns:jpa="http://www.springframework.org/schema/data/jpa" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
- xmlns:util="http://www.springframework.org/schema/util"
- xmlns:repository="http://www.springframework.org/schema/data/repository"
- xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:aop="http://www.springframework.org/schema/aop"
- xsi:schemaLocation="
- http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
- http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
- http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
- http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
- http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
- http://www.springframework.org/schema/data/repository http://www.springframework.org/schema/data/repository/spring-repository.xsd
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"
- default-lazy-init="true">
- <description>Spring Mybatis 配置 </description>
- <bean id="dataSource" class="com.xt.js.gkaq.web.system.DataSourceFactory"
- init-method="init" destroy-method="close">
- <property name="properties" value="classpath:/spring/dataSource.properties" />
- <property name="dsType" value="com.alibaba.druid.pool.DruidDataSource"></property>
- </bean>
- <!-- ================== mybatis ==================================== -->
- <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="dataSource" />
- <property name="mapperLocations" value="classpath:com/xt/js/gkaq/*/mappers/*.xml" />
- <!-- 配置Mybatis的插件plugin -->
- <property name="plugins">
- <array>
- <bean class="com.yuanxd.tools.pagehelper.PageHelper">
- <property name="properties">
- <value>
- dialect=oracle
- </value>
- </property>
- </bean>
- </array>
- </property>
- </bean>
- <!-- 配置扫描器 -->
- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <!-- 扫描me.gacl.dao这个包以及它的子包下的所有映射接口类 -->
- <property name="basePackage" value="com.xt.js.gkaq.*.mappers" />
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
- </bean>
- <!-- ========================================事务配置========================================= -->
- <!-- 配置Spring的事务管理器 -->
- <bean id="transactionManager"
- class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource" ref="dataSource" />
- </bean>
- <aop:aspectj-autoproxy proxy-target-class="true" />
- <!-- 注解方式配置事物 -->
- <tx:annotation-driven transaction-manager="transactionManager" />
- </beans>
|