|第一个 * —— 通配 随便率性返回值类型|
|第二个 * —— 通配包com.evan.crm.service下的随便率性class|
|第三个 * —— 通配包com.evan.crm.service下的随便率性class的随便率性办法|
|第四个 .. —— 通配 办法可以有0个或多个参数|
<!-- 配置那些类的方法进行事务管理 -->
<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 !写,国内一般用|| && !。
原文地址:http://hi.baidu.com/suofang/item/1bea72b7315c3497194697ea
本文介绍如何在Spring AOP中配置事务管理,通过使用通配符表达式来指定哪些类的方法需要进行事务控制。详细解析了通配符在表达式中的含义,并提供了具体的配置示例。
630

被折叠的 条评论
为什么被折叠?



