-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: How to use Hibernate Interceptor in JPA apis(EntityManager)?
PostPosted: Wed Jan 23, 2008 10:17 pm 
Newbie

Joined: Wed Jan 23, 2008 9:49 pm
Posts: 4
hi all.
i use Spring2.5, JPA(EntityManager) and hibernate to build my application.
we have a demand that we must generate audit log for each dao method.

JPA's callback and listener is too simple to do this and it seems hibernate interceptor must be used in Configuration, sessionFactory these non-JPA APIs.

my current solution is using spring aop but it can't keep track of the modify of the entity fields.

my question is

how to use Hibernate Interceptor in JPA apis(EntityManager)?
or
how to create audit logs for dao methods naturally in jpa?


any reply will be appreciate. thx.


Hibernate version: 3.2? (copy from JBossSeam 2.0GA libs)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 23, 2008 10:59 pm 
Newbie

Joined: Wed Jan 23, 2008 9:49 pm
Posts: 4
now i know how to do this

edit persistence.xml

<properties>
<property name="hibernate.ejb.interceptor" value="net.jeffrey.AuditInterceptor"/>
</properties>

but i have a new problem that is this interceptor can't inject any spring managed beans so i still can't use dao in callback.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.