日期:2014-05-17 浏览次数:21180 次
<!-- 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>
推荐阅读更多>
-
js jquery 怎么实现预览
-
SSH查询出现空指针异常
-
怎么根据 子窗口的 名称 获取子窗口的 对象
-
数据库中文乱码解决方法
-
接口中的步骤加和不加abstract有啥区别?(冒着被鄙视风险)
-
spring mvc3 使用jackson返回json时候无限循环
-
int i=一;intj=1;开辟了多大的内存
-
两个不同页面之间的HMTL组件怎么交互
-
关于hibernate的映射有关问题
-
Hibernate操作数据库 报错java.lang.Integer cannot be cast to java.lang.String如何改
-
最近学了JAVA,其他语言都没学过,感觉少缺少点什么,想学C语言。解决方法
-
jsp的textarea中的随便位置加入图片
-
,多谢各位
-
Hibernate拆分多对多关系,该如何处理
-
【有关问题-2】EclipseMe里面的一个选项-Enable Preprocessing是做什么用的
-
加法多线程,该如何处理
-
关于struts标签<html:link/>中汉字编码的有关问题
-
这是咋回事啊
-
奇怪的字符编码有关问题求解
-
如何在ECLIPSE3.2中配置LOMBOZ插件啊