日期:2014-05-17 浏览次数:20920 次
<!-- 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实现以及分析?
-
判断用户是否在数据库内异常了
-
议论帖:java与.net的优略势
-
j2me界面怎么传参
-
【关于正则表达式】求大神解决解决思路
-
Spring初学者请教
-
rss与jsp怎么结合在一起
-
connection as SYS should be as SYSDBA or SYSOPER,该如何解决
-
使用eclipse开发遇到的有关问题,.
-
想用java开发一套erp,不知道该采用什么框架好一点呢,该怎么解决
-
Java SE: 对象调用,该怎么处理
-
java程序确定单数
-
IO流 InputStream类的read方法 何时返回-1 何时阻塞,该如何解决
-
标题栏怎么去掉IP地址的显示?
-
Cannot create PoolableConnectionFactory (尝试连线已失败。)解决思路
-
JSF2.0有关问题
-
java中为什么要用下转型和上转型 虽然知道是为了体现多态性 不知道如何体现 求帮小弟我举个例子
-
C# 代码转换成JAVA代码 (跪求),该如何解决
-
struts1 关于从action到JSP传值的有关问题