日期:2014-05-17 浏览次数:20981 次
<!-- 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>
推荐阅读更多>
-
关于全局变量的批改
-
编程有关问题,请问下,
-
急求SQL语句!大侠救命!该怎么解决
-
怎样获取95到100之间的随机数?多谢
-
java线程执行sql报指针null的异常
-
lucene4.4复合模糊查询,该如何解决
-
请教有没办法在代码里,获得当前项目部署的服务器IP地址
-
快第一个学期毕业设计,求老鸟指教,该怎么解决
-
关于用JAVA作PC端应用图标按钮的有关问题
-
WinXP+SP2,sql server2000个人版+SP3,数据库连接有关问题
-
java字符串中截取字符串,该怎么解决
-
runtime调用shell下令 带参数以及环境变量的设置
-
大侠们,可不可以推荐一本你们学过的写js脚本的书
-
急数据读取有关问题,跪求大侠们帮忙
-
为什么是把一整个读完以后才输出到客户端,而不是读一次输出一次解决办法
-
问一下反射的优点?解决方法
-
不打开新窗口,能不能定制当前窗口?该怎么解决
-
struts工作流程~解决方法
-
关于ImageItem的有关问题!
-
Servlet中怎么获取response的statusCode