-->
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: Event listeners on collection updates
PostPosted: Mon May 28, 2007 5:20 am 
Newbie

Joined: Mon May 28, 2007 4:55 am
Posts: 1
Hi,

I'm trying to make a bean level validation mechanism and I encountered a case in which I wanted to validate a property of a bean which is in fact a collection.
The problem is that if only the collection is modified, Hibernate won't generate a pre-update event on the entity since the collection is not actually regarded as part of the state of the entity. The only event that seems to help somewhat is the session flushing event but it is rather general for this particular case.
I actually used Hibernate Validation to create a bean level validation annotation whose validator calls a method on the bean that does the actual validation. So I used the pre-update / pre-insert listeners from H Validation.
The question is: is there any event mechanism specific to collection operations that I missed and if not what do you think would be the best approach to somehow "pass" the event to the entity?

Thanks,

Alex


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.