日期:2014-05-17 浏览次数:21401 次
<!-- 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 实习生)大家看看给个评论(目前纠结是继续留上实习还是换公司实习)在线聊
-
急利用正则表达式替换图片地址解决方法
-
急配置tomcat7后,双击startup.bat 闪了一上就没了。求帮助
-
如果使用数据库连接池有关问题
-
中缀表达式转为前缀表达式,该怎么处理
-
对于用ireport做交叉报表
-
数据库的连接有关问题
-
有人开发过基于P2P的网络电视软件吗?解决办法
-
请教怎么怎么在网页上进行串口通信
-
付禄娃软件工程师小网站初步上线,继续完善ing!【100分送给好人哦 (*) 嘻嘻】
-
向高手在java程序中怎么使用外部命令(如java命令)执行已编译好了的java程序,并且希望能够输入数据和输出数据
-
新手提问`该如何解决
-
java scoket有关问题
-
100分大奉送!求先人
-
密码正则表达式验证解决方案
-
坦克死火了,为何!
-
java文件上载时,总停在上载处不动了。请大侠帮忙
-
敢問诸位大俠,項目中的版本控制你們都是怎麽實現的呀
-
关于dom4j查询xml 建web project没事 建java project运行就会出错,该怎么处理
-
请问高人小弟我该做什么