• spring配置


    <?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:tx="http://www.springframework.org/schema/tx"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
               http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
               http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
    	<bean id="dataSource"
    		class="org.apache.commons.dbcp.BasicDataSource">
    		<property name="driverClassName"
    			value="oracle.jdbc.driver.OracleDriver">
    		</property>
    		<property name="url"
    			value="jdbc:oracle:thin:@10.6.78.7:1521:meterial">
    		</property>
    		<property name="username" value="plan"></property>
    		<property name="password" value="plan"></property>
    	</bean> 
    	<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
    		<property name="configLocation">
    			<value>classpath:SqlMapConfig.xml</value>
    		</property>
    		<property name="dataSource">
    			<ref local="dataSource" />
    		</property>
    	</bean>
    
    	<bean id="transactionManager"
    		class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    		<property name="dataSource" ref="dataSource" />
    	</bean>
    
    	<tx:advice id="txAdvice" transaction-manager="transactionManager">
    		<tx:attributes>
    			<tx:method name="save*" propagation="REQUIRED" />
    			<tx:method name="del*" propagation="REQUIRED" />
    			<tx:method name="update*" propagation="REQUIRED" />
    			<tx:method name="*" read-only="true" />
    		</tx:attributes>
    	</tx:advice>
    
    	<aop:config>
    		<aop:pointcut id="allManagerMethod"
    			expression="execution(* byd.service.impl.*.*(..))" />
    		<aop:advisor advice-ref="txAdvice" pointcut-ref="allManagerMethod" />
    	</aop:config>
    </beans>
    <?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:tx="http://www.springframework.org/schema/tx"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
               http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
               http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
         <!-- 树 -->
    	<bean id="baseDao" class="byd.dao.CurdBaseDaoImpl">
    		<property name="sqlMapClient" ref="sqlMapClient" />
    	</bean>
    </beans>
     
    <?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:tx="http://www.springframework.org/schema/tx"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
               http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
               http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
         <!-- 树 -->
         <bean id="baseService" class="byd.service.impl.ICrudBaseServiceImpl">
    		<property name="baseDao" ref="baseDao" />
    	</bean>
    </beans>
    
     
    <?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:tx="http://www.springframework.org/schema/tx"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
               http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
               http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
         <!-- 树 -->
         <bean id="baseService" class="byd.service.impl.ICrudBaseServiceImpl">
    		<property name="baseDao" ref="baseDao" />
    	</bean>
    </beans>
    
     
    <?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:tx="http://www.springframework.org/schema/tx"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
               http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
               http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
        <!-- 树 -->
    	<bean name="treeAction" class="byd.action.TreeAction" scope="prototype">
    		<property name="baseService" ref="baseService" />
    	</bean>
    	<!-- 用户管理 -->
    	<bean name="userAction" class="byd.action.UserAction" scope="prototype">
    		<property name="baseService" ref="baseService"/>
    	</bean>
    	<!-- 部门管理 -->
    	<bean name="deptAction" class="byd.action.DeptAction" scope="prototype">
    		<property name="baseService" ref="baseService"/>
    	</bean>
    	<!-- 项目管理 -->
    	<bean name="itemAction" class="byd.action.ItemAction" scope="prototype">
    		<property name="baseService" ref="baseService"/>
    	</bean>
    	<!-- 项目考核 -->
    	<bean name="itemCheckAction" class="byd.action.ItemCheckAction" scope="prototype">
    		<property name="baseService" ref="baseService"/>
    	</bean>
    </beans>
    
     
  • 相关阅读:
    秒杀场景:如何通过 Redis 减库存?
    eclipse启动报failed to find a Main Class in C:\users\2008nmj\eclipse\java201812\eclipse....jar
    pgr_createTopology创建网络失败。。
    Cesium之Sandbox
    java JDK版本修改不生效的解决方法
    云上360行丨深耕快消品行业数字化转型,纷享销客与华为云合力同行
    华为云Stack首席架构师:打造“称手”的数字化工具,答好政企IT数字化转型这道必选题
    认识一下什么是JSP
    想发自己的NFT,你要先搞清楚这6个问题
    教你搭建一个Telegraf+Influxdb+Grafana 监控系统
  • 原文地址:https://www.cnblogs.com/qq1988627/p/6606922.html
Copyright © 2020-2023  润新知