<!-- 配置那些类的方法进行事务管理 --> 
<aop:config> 
<aop:pointcut id="allServiceMethod" expression="execution (* com.cms.sys.service.*.*(..))" /> 
<aop:advisor advice-ref="txAdvice" pointcut-ref="allServiceMethod" /> 
</aop:config> 

还有一个 execution (* com.cms.art.service.*.*(..))" 要怎么写? 

 

可以这样写:将execution分开写。 

<aop:config> 
<aop:pointcut id="allServiceMethod" expression="(execution (* com.cms.sys.service.*.*(..))) or (execution (* com.cms.art.service.*.*(..)))" /> 
<aop:advisor advice-ref="txAdvice" pointcut-ref="allServiceMethod" /> 
</aop:config> 

老外喜欢把逻辑运算符用or,and 写,国内一般用|| && !。 

相关文章:

  • 2022-02-03
猜你喜欢
  • 2022-12-23
  • 2021-07-08
  • 2022-02-03
  • 2021-06-26
相关资源
相似解决方案