日期:2014-05-17 浏览次数:21062 次
<!-- 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>
推荐阅读更多>
-
关于commit()动作的一个有关问题,请老师解答
-
可以帮小弟我看看int i = sm.executeUpdate(sql); 为什么出错了么
-
求指点 - - 小弟我是初学者
-
jsp 调用excel打印 怎么用代码设置页面横打
-
java freemarker 导出 word解决方案
-
hibernate+struts框架,剔除操作有的时候可以成功,有的时候只能跳转,不能删除
-
java.lang.NullPointerException错误
-
[200分]怎么能把jsp页面textarea输入框中输入内容的回车和段前的空格[排版]在提交后都保存到数据库[急等]
-
java学到什么程度可以一般去应聘
-
用java导出excel表格有关问题
-
java和C++之间 des加密解密遇到有关问题!
-
怎么找Jar文件
-
用什么形式动态选择编码方式
-
跟一家公司签了三方协议,单位违约了,小弟我该如何维护自己的权利
-
昨日的面试题
-
CSV,排序的有关问题(急)
-
怎么页面一次性提交多个相同类型的form?或者提交表格
-
请问一个构造函数的有关问题 多谢
-
用Java解决文本中的过滤有关问题!
-
action运行了两次解决思路