15 Star 14 Fork 4

Jason.Ma / JMini

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
spring-jmini-fw.xml 3.46 KB
一键复制 编辑 原始数据 按行查看 历史
Jason.Ma 提交于 2015-12-11 11:10 . 项目基本版本差un感觉
<?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:aop="http://www.springframework.org/schema/aop"
xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<bean class="jmini.examples.spring.MyPropertyPlaceholderConfigurer"></bean>
<!-- Scans the class path of this application for @Components to deploy as beans -->
<context:component-scan base-package="jmini.service,jmini.dao">
<!-- 扫描符合@Service @Repository的类 -->
<context:include-filter type="annotation" expression="org.springframework.stereotype.Service" />
<context:include-filter type="annotation" expression="org.springframework.stereotype.Repository" />
</context:component-scan>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="${db.mysql.url}" />
<property name="username" value="${db.mysql.username}" />
<property name="password" value="${db.mysql.password}" />
<property name="maxWait" value="300000" />
<property name="initialSize" value="20" />
<property name="maxActive" value="50" />
<property name="maxIdle" value="5" />
<property name="minIdle" value="10" />
<property name="testWhileIdle" value="true" />
<property name="timeBetweenEvictionRunsMillis" value="15000" />
<property name="numTestsPerEvictionRun" value="20" />
<property name="validationQuery" value="SELECT 1" />
<property name="removeAbandoned" value="true" />
<property name="removeAbandonedTimeout" value="180" />
<property name="connectionProperties">
<value>clientEncoding=utf-8</value>
</property>
</bean>
<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<aop:config>
<aop:pointcut id="serviceOperation" expression="execution(* com.anapp.fw.iservice..*Service.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="serviceOperation" />
</aop:config>
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="remove*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="query*" propagation="REQUIRED" read-only="true" />
<tx:method name="count*" propagation="REQUIRED" read-only="true" />
<tx:method name="sum*" propagation="REQUIRED" read-only="true" />
<tx:method name="*" propagation="SUPPORTS" read-only="true" />
</tx:attributes>
</tx:advice>
<bean id="jminiTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource" />
</bean>
</beans>
Java
1
https://gitee.com/machangsheng/JMini.git
git@gitee.com:machangsheng/JMini.git
machangsheng
JMini
JMini
master

搜索帮助