日期:2014-05-17 浏览次数:21172 次
<!-- 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>
推荐阅读更多>
-
tomcat上项目运行缓慢的有关问题
-
请问怎么学习JAVA,务实、能换位思考的人请进来
-
有关HashEntry的一个有关问题
-
定义一个雇员类?该怎么处理
-
JAVA之路在何方,该如何解决
-
简单包装事件处理代码之-自定义事件解决方案
-
如何static 还可以这样用呀? !
-
一个算法有关问题
-
求解java计算器代码,该如何处理
-
java编译时出现Window不是抽象的,如何解决
-
servlet获取session属性值,出现问指针错误的有关问题
-
struts2有什么美的命名规范么
-
java 连接数据库有两个类来实现,实现方式都差不多,但是否调查用任意的类,是不是会产生两个连接池?解决方法
-
iBatis对BLOB数据读写,但update不成功,该如何处理
-
,几个死锁栈信息,请高手帮忙分析一下 多谢
-
为什么用迅雷上载xls格式的文件,最后会变成html格式的,但是如果用ie上载,就很正常了!求解!
-
jersey 怎么重定向
-
消费者生产者有关问题
-
jquery name选择器回来value数组
-
执行getHibernateTemplate.save(user)后,控制台已经显示出sql插入语句,但数据库里并没有数据?解决思路