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.
|