日期:2014-05-17 浏览次数:20925 次
<!-- 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>
推荐阅读更多>
-
String substring()截取的有关问题
-
支招学java,该如何解决
-
POI的一个有关问题
-
向高手请问!关于Java中String的一些疑问
-
【初学者】初学Java,用什么软件运行程序呢
-
java项目 加载数据内存溢出怎么回事 数据少时正常多了就不行
-
大侠
-
J2EE上载服务器端文件
-
struts2中在地址后传递参数的有关问题
-
从J2SE如何迈向J2EE
-
动态加载一个未知的类?解决方案
-
JSP怎么引用class檔
-
关于页面的一些有关问题(不知道是跳转出有关问题,还是其他出有关问题)
-
jsp显示本地图片解决办法
-
做出来的小GUI程序打JAR包后双击没反应解决办法
-
用Myeclipse编写框架报错有关问题,求指点
-
在struts2中怎么将一个Arraylist中的所有数据值显示到jsp页面上。
-
初学者请问个简单有关问题:winXP下j2sdk1.4.2+tomcat5.0如何配置?
-
更改文件名出现异常求解释
-
JSP中的java代码,强制使用try catch?解决方案