日期:2014-05-17 浏览次数:21060 次
<!-- 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>
推荐阅读更多>
-
怎么在jsp中获得数据库中的信息,求
-
.do跟jsp哪个好
-
d:\My Documents\tp\PIC_1929.jpg 如何样获取PIC_1929.jpg这段字符
-
回复帖子,点击提交之后,重新载入该帖子,应该如何写啊请高人指导一下,谢啦
-
snmp4j想测试snmp服务,XP怎样配置代理解决办法
-
数组在内存中的分析(需要专业回答)解决方法
-
用户登录时的ip限制有关问题
-
displaytag有关问题,两页以上出有关问题
-
最后的17分,求藏文字符集的有关问题,多谢
-
tomcat的webapps上面有部署好的项目,但就是访问不到,求解
-
Calendar.DAy_OF_WEEK的打印,该怎么处理
-
jsp+ajax,如何小弟我的返回值中有那么多空行
-
求救!小弟我写的单个线程会自动随机地停止
-
取得对象数组的内部锁,是否也意味着取得每个对象的内部锁?该如何解决
-
〓〓〓JSP的读取数据类-怎么将记录集转为二维数组返回
-
刚学用annotation写hibernate,出有关问题啦。
-
刚开始学struts,到处搜不到答案,该如何解决
-
DynaActionForm的有关问题
-
java新手提问,该怎么解决
-
struts1 空指针异常,比较简单! 有代码