日期:2014-05-17 浏览次数:21072 次
<!-- 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>
推荐阅读更多>
-
感悟面试论,该怎么处理
-
关于Java的循环引用和内存泄露有关问题
-
MYSQL怎么实现父子关系的级联查询
-
Spring+Hibernate框架上Mysql读写分离、主从数据库配置无法选择数据源
-
myeclipse9不能使用spring, 没add spring capabilities菜单
-
关于if的,相信很多人和小弟我一样有点不懂
-
SSH 注脚 使用filter实现自动登录
-
软件工程师坚持何时
-
为什么实现不了弹出自定义的对话框解决办法
-
动车记者,真假小弟我也不知道,作为良知的中国人,小弟我转发一下,多谢
-
mySQL序列自增长有关问题
-
一个很简单的有关问题,答对给分
-
在jsp中向oracle安插一行数据
-
java程序打包成jar,出错了,怎么看发生什么东东
-
学习struts+spring+hibernate需要配置什么样的环境,该怎么解决
-
急求SQL有关问题与JAVA程序有关问题。
-
高兴,散分4解决思路
-
最近在学习WEB系统的开发,请问一下目前国内比较成熟的UI框架和报表有哪些
-
struts2.1.6 版本中,没有 s:datetimepicker标签,怎么才能使用时间控制选择器?
-
jsp servlet session有关问题,在线救教!