日期:2014-05-17 浏览次数:21047 次
<!-- 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>
推荐阅读更多>
-
在request参数中过滤掉一个一个参数的有关问题?(不用传统的过滤器实现)
-
jsp mysql 连接异常
-
servlet中的session怎么与action中的session同步
-
项目管理读物
-
Spring无法加载有关问题:org.springframework.web.servlet.DispatcherServlet。
-
jsp 调用jasper 却什么都没显示出来 为什么?该怎么处理
-
新手想问些有关问题 希望大家指教
-
请问一个 继承中覆盖方法之后调用super访问父类完全相同的方法 的有关问题
-
跟大家分享一下,json中文传值有关问题
-
JAVAMAIL收邮件发邮件共存有关问题
-
土豆网中的主键是如何生成的? 如:AqK4XVaSiYE ,nXDh2lsb_Tc
-
讨论,struts标签和EL解决方案
-
jsp 反应如何那么木啊跪地求解
-
关于MyEclipse运行时的有关问题——无法载入sun/plugin/JavaRunTime类
-
念问问jsp的数据一开始就加载好是用jq的ajax么
-
java中怎么识别日文全角字
-
有人试过用JAVA开发INTEL等CPU平台的操作系统吗?解决办法
-
有个异常不明白啥意思
-
js如何实现页面数据排序 要求table里的第一列不参加排序
-
关于java在web方面的开发需要什么准备解决方法