-->
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 determine if the particular object is dirty ?
PostPosted: Thu Feb 26, 2004 11:20 am 
Newbie

Joined: Thu Feb 26, 2004 11:13 am
Posts: 3
Hi,

using Session.isDirty() I can determine if the session is dirty.

But how can I determine if the particular persistent object
is dirty (i.e. was modified and needs to be saved) ?

Is there a way how to get such information from Hibernate ?


Thanks,
Stm


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 26, 2004 12:07 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
This can be accomplished via the Interceptor.onFlushDirty() method. When the session is being flushed, this will get called for each object that Hibernate found to be dirty within the bound of the session.

There is not currently a way to ask a Hibernate Session if it considers a particular object instance dirty through the public APIs. If you really really really want to do this, you can take a look at the SessionImpl class to see how it does it, and then replicate that logic yourself; but I would recommend the Interceptor approach.


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.