日期:2014-05-17 浏览次数:21286 次
<!-- 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>
推荐阅读更多>
-
freemaker的使用,求教啊解决方案
-
java批量打包下载解决思路
-
关于构造器的有关问题
-
一个奇怪的结果?如何解释这段代码
-
关于tomcat服务器的有关问题
-
120分求解决啊该如何解决
-
Servlet怎么获取ajax中以json格式传入的数据
-
本人用Java写的传奇 (网游,非单机)有视频解决方法
-
java.lang.IllegalStateException: getWriter() has already been called for this response
-
在JSP页面里怎么高亮显示从数据库提取出来的数据
-
[初学者有关问题] JSP页怎么调用自己写的class
-
怎么比较迭代(Iterator)出来的数据是否相等
-
为什么当小弟我管理员密码这项 不输入的时候 也能登陆成功那小弟我明明对他判断了 请高手仔细给看看代码
-
本人像学习J2ME大家给点意见解决办法
-
【散分】闲聊,该如何处理
-
extjs交互解决方案
-
jdbc解决方案
-
hibernate 一对一解决方法
-
java一个链接数据库的类里一个实例不能调用两个步骤
-
还是java键盘监听有关问题,测试程序中没有关问题,主程序中仍然不监听