日期:2014-05-17 浏览次数:21096 次
<!-- TransactionManager -->
<bean id="hibTransactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<tx:advice id="txAdvice" transaction-manager="hibTransactionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED" />
<tx:method name="del*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="select*" propagation="REQUIRED"/>
<tx:method name="search*" propagation="REQUIRED"/>
<tx:method name="insert*" propagation="REQUIRED" />
<tx:method name="do*" propagation="REQUIRED" />
<tx:method name="*" propagation="SUPPORTS" read-only="true" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut expression="execution(* biz.*.*(..))"
id="bizMethods" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="bizMethods" />
</aop:config>
<!--
********************************我是很长的分割线********************************
-->
<!-- Dao -->
<bean id="petDiaryDao" class="dao.impl.hib.PetDiaryDaoHibImpl">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="petInfoDao" class="dao.impl.hib.PetInfoDaoHibImpl">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<!--
********************************我是很长的分割线********************************
-->
<!-- Biz -->
<bean id="petDiaryBizTarget" class="biz.impl.PetDiaryBizImpl">
<property name="petDiaryDao" ref="petDiaryDao" />
</bean>
<bean id="petInfoBizTarget" class="impl.PetInfoBizImpl">
<property name="petInfoDao" ref="petInfoDao" />
</bean>
<!--
********************************我是很长的分割线********************************
-->
<!-- Advice -->
<bean id="lotteryAdvice" class="advice.LotteryAdvice">
<property name="petInfoBiz" ref="petInfoBizTarget" />
</bean>
<bean id="petInfoBiz" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces" value="biz.PetInfoBiz" />
<property name="interceptorNames" value="lotteryAdvice" />
<property name="target" ref="petInfoBizTarget" />
</bean>
<bean id="petDiaryBiz" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="ProxyInterfaces" value="biz.PetDiaryBiz" />
<property name="interceptorNames" value="lotteryAdvice" />
<property name="target" ref="petDiaryBizTarget" />
</bean>
推荐阅读更多>
-
javabean使用有有关问题 各位大侠帮忙!烦死我了
-
同一个过滤器,WEB.XML怎么设置两个参数
-
ft,关于j2me中文教程 1.01修正版中52页的一个代码有关问题
-
!另类文件夹操作有关问题
-
JVM参数配置的重大疑惑解决办法
-
新人,不急求详细代码,初级学员,学到了循环,求看得懂
-
在html的<head>里加入<meta http-equiv=pragma content=no-cache>的有关问题
-
大侠门帮帮忙看看这几行日志,该怎么解决
-
请教 : &x开头的是unicode字符么,如何转换为utf-8
-
【初学java】for循环内循环变量用16进制数可以吗?打印希腊字母遇到有关问题
-
spring mvc 拦截器 阻截不到请求
-
double门类四舍五入取两位小数,java中程序怎样写
-
初学 问个概念。
-
有关J2SE 5.0以后提供的自动装箱和拆箱。该如何处理
-
求帮助!多谢,帮忙找异常@
-
Java绘图的有关问题
-
resin的class文件不更新 求解解决方法
-
关于公司和部门的排序有关问题
-
怎么html跳转action中的一个方法
-
有人知道广州易方达公司如何样吗