Results 1 to 3 of 3

Thread: Hibernate interceptor

  1. #1

    Default Hibernate interceptor

    Hi,

    I'd like to add a log of all the hibernate action in my webapp.

    For this i think that an interceptor is better than putting additionnal code.

    If someone as an example for this, i'll be happy to read an implementation. ;-)

    Thanks,

    Fabien.

  2. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    For an example of Hibernate Interceptor, take a look at Interceptors of Hibernate Documentation.

    To configure a Hibernate Interceptor with a LocalSessionFactoryBean, use the following:
    Code:
    <bean id="myInterceptor" class="com.company.MyInterceptor"/>
    <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean"> 
      <property name="entityInterceptor">
        <ref bean="myInterceptor"/>
      </property>
    </bean>
    HTH
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  3. #3

    Default

    ok that's ok irbouho thanks,

    Fabien.

Similar Threads

  1. Replies: 14
    Last Post: Apr 25th, 2008, 05:01 AM
  2. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  3. Hibernate Template or AOP Interceptor?
    By etienno in forum Data
    Replies: 1
    Last Post: Apr 15th, 2005, 02:44 AM
  4. Replies: 1
    Last Post: Nov 29th, 2004, 08:35 PM
  5. Replies: 3
    Last Post: Nov 19th, 2004, 07:16 PM

Posting Permissions

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