日期:2014-05-17 浏览次数:20844 次
<!-- 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>
![]()
推荐阅读更多>
- 判断一行字符串是否到尾字符,该怎么处理
- 求jdbc连接mysql的小程序,能有查询 修改功能解决方法
- 文件下传时的类型转换
- 有哪位高手用过selectM(按ctrl可同时选中多个选项)
- MyEclipse环境下如何配置Resin服务器,请前辈指点
- 一个js函数写法
- J2ME上载并读取服务器txt文件
- Java中抽象类不能实例化,这里是不是进行实例化了?不懂
- java 数据库保存图片文件抛出错误
- 求推荐一本spring的书吧。解决思路
- 然后查看邮件原始文件信息,该如何解决
- eclipse及插件下载,该如何处理
- java配置有关问题,环境变量定义好的,但是javac打不开
- 救命了.怎么禁用HTML啊?救命了.怎么禁用HTML啊?
- JMF 视频程序写入文件异常
- 学了快一年 java,今天才弄明白设置classpath的作用,该如何处理
- IE浏览器无法显示页面并自动下载有关问题
- swing干的界面,为啥要拖动边框才能显示里面的内容?
- js显示时间,该如何处理
- 在EJB3.0中,怎么得到多个EntityManager实例来控制对不同数据库的连接呢