日期:2014-05-17 浏览次数:20821 次
<!-- 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>
![]()
推荐阅读更多>
- java.lang.ArrayIndexOutOfBoundsException
- 论坛发帖时候的上传附件是如何实现的。
- 如何看hibernate的源码
- 怎么快速搭建较为合理的j2EE框架
- JFreeChart图例设立
- 一个关于session与request的有关问题
- Could not execute JDBC batch update;nested exception is org.hibernate.exception,该如何解决
- 请教下面一段字符是什么
- 怎么用ajax,json实现发送xml到服务器端,再解析从服务器端返回的xml
- 一个有趣的有关问题的i++有关问题。求原因!
- 查询出大量的数据,使用checkbook进行全选,怎么解决效率有关问题
- 网上找的一个java applet 画图板程序,运行出错,大家帮小弟我看看什么有关问题
- executeUpdate 返回值没有 触发器解决思路
- 从.Net转Java,恳求各位给点建议
- 新人求教用struts2 别人用一个下载地址下东西,如何知道别人打开这个链接下载呢
- 哪位有兴趣帮俺做个RFID方面的 demo,小弟我可以提供交换,如arm开发项目 呵呵
- 在数据库中设置float类型数据的有关问题
- 求大神发一下java基础的练习题给小弟我
- 中文字符编码有关问题
- java错误的有关问题