Specifically, i have a class (or 2) in which i want to check to see if an item is null, If so, i need to make perform some calculations and go to the DB to change it.
I have used listeners and trapped the class of interest. However, any change i make to the property does not take place. Null is still inserted into the db.
In fact, it appears that i can't make any changes to elements onFlush or onSaveOrUpdate.
Is there another listener i should use? (onDirtyCheck?) Should i be using an interceptor? Is what i'm trying to do possible (i sure hope so).
There is little docmentation on listeners, and most examples are listeners that write audits, etc. None that i can find actually change the value of a property on the persistent entity.
Is there any place that details precisely what is doable on each event?
any help would be appreciated.
_________________ Please rate this reply if it helps!!
|