-->
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: Interceptor onCollection*() methods
PostPosted: Wed Oct 10, 2007 11:42 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
I'm writing an interceptor, including the various onCollection[Recreate, Update, Remove] methods. I'd like to note which collection is being changed. That is, if a collection in my Foo object, as mapped to property Bar, is being updated, I want access to the string "bar".

The collection parameter is a PersistentCollection, so I can call getOwner(). But I can't seem to find the property from either the owner or the PersistentCollection.

I've looked at the code in AbstractFlushingEventListener, and it looks like the information is available there. The current collection persister is there, and (I think) that ce.getCurrentPersister().getCollectionMetaData().getRole() is what I'm looking for.

Have I analysed this correctly? Is what I'm looking for not available at the place I need it? And should I raise a JIRA issue requesting that it be added? It seems like a reasonable thing to want, as it's handy for auditing, useful log messages, and any number of other uses in the onCollection* methods.

_________________
Code tags are your friend. Know them and use them.


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.