关于AOP拦截MyBatis 的DAO接口

思灵月 思灵月 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我AOP配置

<aop:aspectj-autoproxy/>
<bean id="myBefore" class="com.test.aop.GetStartEnd"></bean>
<aop:config>
<aop:aspect id="abcd" ref="myBefore">
<!-- <aop:pointcut id="myPointcut" expression="execution(* com.abc.ebook.service.impl.*.*(..))"/> -->
<aop:pointcut id="myPointcut" expression="execution(* com.abc.ebook.dao.impl.*.*(..))"/>
<aop:before pointcut-ref="myPointcut" method="aa"/>
<aop:after pointcut-ref="myPointcut" method="bb"/>
</aop:aspect>
</aop:config>


因为MyBatis的DAO层是没有实现类的,调试的时候也发现,压根就没有进入impl包的方法里面,
所以以上配置不起效果,但是我要在这一层进行拦截啊,需要对每个方法的前后切入一些逻辑,我该怎么做呢?

...全文
评论 2
收藏 已收藏
分享
返回顶部
思灵月
Java EE 67,535 成员 225,843 内容