-->
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: Get created / updated / deleted entities out of a session.
PostPosted: Tue Jul 25, 2006 9:55 am 
Newbie

Joined: Mon Jan 30, 2006 5:14 pm
Posts: 8
Location: Amsterdam, Netherlands
Hi,

I'd like to obtain information about which entities (instances) were created / updated / deleted during a given session, up until the moment of flushing.
Rationale: before flush, I'd like to execute some additional business logic (amongst wich validation) on these entities.

Currently, I wrote an interceptor that maintains a created / updated / deleted collection by itself. It adds the objects that it receives from the onSave, onDelete etc. callbacks. Before flush, I inquire the interceptor for its collections, and I execute the required methods on the collection's objects. Rationale: allow for "coarse grained" validation and correction before flush.

However, by maintaining these collections, I feel that I am duplicating information from the Hibernate internal administration.

I was wondering whether there is another way of yielding this information from the session ? I looked at the statistics interfaces in org.hibernate.stat, but these do not seem to give me the information I need.

Many thanks,

- Fernand.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 26, 2006 3:36 am 
Newbie

Joined: Mon Jan 30, 2006 5:14 pm
Posts: 8
Location: Amsterdam, Netherlands
A-ha - just saw a similar approach / similar request for session.getDirtyEntities() at

http://www.hibernate.org/156.html


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.