日期:2014-05-17 浏览次数:21236 次
<!-- 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>
推荐阅读更多>
-
执行Person p=new Person()这句java程序的时候,P放在什么地方?解决思路
-
奇怪了解决办法
-
请教一个关于jsp调用函数的简单有关问题?
-
ResultSet应该如何样赋值呢
-
100分, org.hibernate.AssertionFailure: null id in com.alpha.bean.AnswerInfo ent解决办法
-
求高效率算法:ArrayList中删除另外一个ArrayList中存在的对象
-
用myeclipse新建JSP文件时自动添加的一些代码有关问题
-
急byte[]的输出有关问题
-
jsp连接excel数据源。连接不上。帮忙。解决方案
-
继续问多线程情况上的数据库操作的线程安全性有关问题
-
简略小实例求解
-
JAVA学习线路,请发表高见还有啥不妥
-
菜鸟的初级有关问题,望能给予指点
-
,java 32位上开发的程序能否运行于java 64位上
-
怎么在Listener或servlet中,使用 spring 使用注解定义的bean
-
jar打包出错的有关问题
-
关于<html:base />的位置有关问题
-
jsp连接数据库的报错!请各位大侠指教一下!解决方法
-
Lwuit的高手请给小弟我指点一下
-
这是神马开发模式?解决方案