-->
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.  [ 1 post ] 
Author Message
 Post subject: JPA callback not called when entity is not dirty
PostPosted: Mon Oct 04, 2010 7:48 am 
Newbie

Joined: Tue Sep 18, 2007 11:24 am
Posts: 9
Hi,

I have written a JPA callback that modify some properties of an entity depending on external conditions. The modification is done in a @PrePersist and @PreUpdate callback.

The problem is the callback is never called as Hibernate considers that the entity is not dirty and consequently do not call JPA callback.

I read JPA spec and it is unclear if it is a Hibernate bug. According to you, should Hibernate call @PrePersist and @PreUpdate callback, then check for "dirtyness" of the entity instead of the current implementation where dirty state is checked before actually calling callback?

Regards,

Julien


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

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.