Results 1 to 5 of 5

Thread: AOP on Hibernate loaded entities

  1. #1

    Default AOP on Hibernate loaded entities

    Hello,

    I post here something which should have been done before but I do not success to find it on the Net :

    I have my own DAO class, which inherits HibernateDAOSupport and is loaded thanks to Spring. The transaction is set on it with Spring too, without problem. All is right !

    However, I want to plug AOP functionalities on the Hibernate loaded entities. For example, my DAO allows me managing Products.

    My class Product has the methods :
    • activate
    • cancel
    • ...


    I want to have an AOP behavior on these methods.

    However, as these products are loaded thanks to Hibernate, Spring has not directly (through the Xml configuration files) access to them.

    How can I plug AOP functionalities on these BOs ?
    Is this possible ?

    Thanks per advance,
    Best regards,
    Thomas

  2. #2
    Join Date
    Jun 2006
    Location
    SF Bay Area, California
    Posts
    524

    Default

    You need to use AspectJ weaving for this.

    -Ramnivas
    Ramnivas Laddad (Follow me on Twitter)
    AspectJ in Action: Enterprise AOP with Spring Applications (2nd edition). Now available!

  3. #3

    Default

    Thanks for your answer.

    I am just looking at this documentation : http://ewawszczyk.developpez.com/tut...va/spring/aop/

    and I am wondering about the behavior of this statement:
    <aop: pointcut id="servicePointcut" expression="execution(* ew.service.*.*(..))"/>
    Can the pointcuts point on a non-Spring bean class ?

    Thanks per advance,
    Best regards.

  4. #4
    Join Date
    Jun 2009
    Posts
    190

    Default

    Spring AOP will work with only spring managed beans.

  5. #5

    Default

    Arf... OK, I will look at AspectJ a little bit more, in order to see if it could be integrable into our projects.

    Thanks for your answers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •