日期:2014-05-17 浏览次数:21222 次
<!-- 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>
推荐阅读更多>
-
数组处置空格
-
Struts2的action中干用户验证
-
ERROR [org.springframework.web.context.ContextLoader] Context initialization fai,该怎么处理
-
struts2+spring+hibernate整合有关问题 Dao注入异常
-
急求答案!解决思路
-
JPA 里面可以配置生成数据库表字段注释(COLUMN_COMMENT)吗?解决方案
-
问个JSP乱码的有关问题,快搞死偶了
-
JSP小编程有关问题,求会的人指导一上如何编
-
split("\\|")对于空字符串,为什么是1,该如何处理
-
util 这个单词是什么意思?该怎么处理
-
登录时候 如何加密解密
-
怎样把两个frame里的form的查询条件组合在一起做一个查询,该怎么解决
-
for(Ball b : new ArrayList<Ball>))是什么意思啊
-
关于jsp中的java代码,解决不了,要被PM骂了,该如何解决
-
CMD执行JAR文件有关问题,求大神指点,用
-
css,js的有关问题,求大神们帮忙,
-
这个异常到底是缺少哪个包还是多了哪个包? !
-
求java.util包的学习资料.该怎么处理
-
再问个有关问题吧,对象设置属性的时候···
-
好吧,大伙儿来优化程序啦