关于spring 声明式事务需要声明多个包中的类的问题

wuxiao_v 2010-03-11 02:31:12
<aop:config>
<aop:pointcut id="serviceMethod" expression="
execution(* com.chnstone.evaluation.system.service.*.* (..)) "/>
<aop:advisor pointcut-ref="serviceMethod" advice-ref="txAdvice"/>
</aop:config>

如果同时还需要声明其他包中的类的某些方法为事务运行, 而且不能用一个表达式概括,应该怎么写。
具体点就是怎么写多个execution 。
...全文
148 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wuxiao_v 2010-03-11
  • 打赏
  • 举报
回复
象我那个 pointcut 和 advisor 是分两个标签配置的, 是不是每个 pointcut 都要带一个自己的advisor ,也就是说他俩是不是都是成对出现的。
bunrise 2010-03-11
  • 打赏
  • 举报
回复
<aop:config>
<aop:advisor pointcut="execution(* com.chnstone.evaluation.system.service.*.*(..))" advice-ref="txAdvice" />
<aop:advisor pointcut="execution(* com.chnstone.evaluation.system.otherservice.*.*(..))" advice-ref="txAdvice" />
</aop:config>
bunrise 2010-03-11
  • 打赏
  • 举报
回复
config可以增加多个,要多少加多少
bunrise 2010-03-11
  • 打赏
  • 举报
回复
<aop:advisor pointcut="execution(* com.chnstone.evaluation.system.service.*.*(..))" advice-ref="txAdvice" />
<aop:advisor pointcut="execution(* com.chnstone.evaluation.system.otherservice.*.*(..))" advice-ref="txAdvice" />
wuxiao_v 2010-03-11
  • 打赏
  • 举报
回复
原来有个提前帖子的按钮,现在怎么没了呢。

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧