intercepting inherited methods with spring aop

Hi

i have a UserDao interface that extends BaseDao and the implementation class is UserDaoHibernate defined as a spring bean.

I'm trying to intercept all kind of delete methods, some are declared in BaseDao, deleteById for example , and some are declared in UserDao, deleteByLogin for example.

using spring aop i can't figure out the pointcut to use:

        <aop:aspect id="deleteUserAspect" ref="deleteUserHandler">
            <aop:around method="handleDeleteUser"
                        pointcut="execution(* com.dao.UserDao.delete*(..))"/>
        </aop:aspect>

with this, spring aop will only intercept methods declared in UserDao but not in BaseDao.

I tried intercepting the class UserDaoHibernate with proxy-target-class="true" but its the same behavior because UserDaoHibernate extends BaseDaoHibernate and only methods declared in UserDaoHibernate are intercepted:

        <aop:aspect id="deleteUserAspect1" ref="deleteUserHandler">
            <aop:around method="handleDeleteUser"
                        pointcut="execution(* com.orm.hibernate.dao.UserDaoHibernate.delete*(..))"/>
        </aop:aspect>

 

any ideas on how to do that?

 

Thank you for your interest!

We will contact you as soon as possible.

Want to Know More?

Oops, something went wrong
Please try again or contact us by email at info@tikalk.com
Thank you for your interest!

We will contact you as soon as possible.

Let's talk

Oops, something went wrong
Please try again or contact us by email at info@tikalk.com