日期:2014-05-17 浏览次数:21220 次
<!-- 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菜鸟,上周六程序设计答辩,窗体设计,在网下找的程序,想自己加个菜单,帮助菜单项怎么实现?望前辈们指导一上,很急谢啦! [有关问题点数:40
-
jsp select有关问题
-
这代码是什么意思?多谢
-
java类之间数据共享的有关问题
-
java list里去掉反复值
-
Java EE 运用中的事务
-
java.uti.Date一個問題解决思路
-
请教哪能下载THINKING IN JAVA?
-
怎么通过socket实现双方通信
-
今天看别人写的代码小弟我感觉好高深,分享下
-
会使用JBuilder2006的,有关jtable和jtree,
-
救命. Struts1和Jsp相关的一个错误 麻烦解答。
-
请教:import java.awt. 与import java.awt.event.有什么区别
-
json,action,jsp的有关问题,困扰好几天了
-
新手提问:怎么将html表单提交到*jsp的信息写入oracle数据库的表中
-
让纯文本自动排版(向FCK一样),该如何处理
-
有关汉字的asc值,该怎么解决
-
怎么在jTable中添加数据呢
-
请教一个Connect Time out的有关问题,多谢
-
关于创建对象的有关问题