Hello everyone!
I try to implement an event handler which sets a „last changed by“-property on my entities. I tried to do this by implementing a PreUpdateEventListener, which doesn’t seem to work for me. I think I am missing something.
My event listener looks like the following code and is configured in the hibernate.cfg.xml.
Code:
public boolean onPreUpdate( PreUpdateEvent arg0 ) {
AbstractEntity e = (AbstractEntity)arg0.getEntity();
e.setUsernameLastChange( "TEST" );
return false;
}
Can someone please point me in the right direction how to implement such a listener? Thank you very much!