日期:2014-05-17 浏览次数:21092 次
<!-- 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>
推荐阅读更多>
-
sruts2上传有关问题。看的是浪曦的视频
-
讨论去路,该怎么解决
-
tomcat起动不自动加载项目
-
字符串“Mon Dec 31 00:00:00 CST 2012”转换成日期有关问题
-
jsp 导出excel有关问题
-
使用Resin3.0.26 + IIS5.1中,JSP生成的XML无法被XmlHttp对象解析,哪位高手帮小弟我解决下
-
jsp与sthml有什么关系吗?解决办法
-
哪位高手有javamail的例子
-
java webService client接收不到服务端返回值,该怎么解决
-
有关计算机专业的学习解决办法
-
远程访问MySQL出现的中文有关问题
-
初学者,自学java能学好吗
-
AspectJ表达式有关问题,求解答
-
EJB3.0 persist 之后,返回自动增长为null的有关问题
-
一个简单的文件拷贝程序,求教小弟我错在哪了
-
Spring异常:Pointcut is malformed: error at :0 formal unbound in
-
StringBuffer是线程安全吗?小弟我有例子说它不是安全的
-
关于自动提交,该如何解决
-
要找房子,请教各位朋友,北京哪里有环境和交通比较方便的大型公寓
-
j2me 发送短信,该如何解决