日期:2014-05-17 浏览次数:21327 次
<!-- 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>
推荐阅读更多>
-
如何样完成毕业设计啊《很有诚意的问一下》
-
关于tomcat6.0+jdk-1_5_0_11的配置有关问题的讨论
-
异常信息:java.rmi.NoSuchObjectException: no such object in table
-
保存到文件夹的控件应该如何做,见帖子内图片
-
微博api开发,怎么获得某个接口对应的类
-
struts2 <s:if test="'sstring' in ${listValue}" >
-
文件上传 怎么读取apk文件的 包名、版本号、图标
-
问个关于access数据库关闭连接的有关问题
-
webroot上的文件夹无法访问,报404异常,附图,请
-
来说说java的书,该怎么解决
-
jsp中如何给按钮添加背景图片
-
求了解getHibernateTemplate()的大侠帮忙讲解下其中方法!该如何解决
-
jsp一般用什么做服务器解决方法
-
www.88doc.com 意见征集先散50分差不多的意见一律给分,不够以后还散!解决思路
-
帮小弟我看看这句代码
-
话说~大家DAO层的类是如何命名的呢
-
getWriter() has already been called,该怎么解决
-
奇怪的有关问题
-
上传图片后以二进制方式保存解决办法
-
事物回滚和不提交有和区别?该怎么解决