|第一個 * —— 通配 隨便率性返回值類型|
|第二個 * —— 通配包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>