Hello,
Vital stats: Hibernate 2.1.2, MySQL 4.0.18
When I save an entity to the Db, I would like to run something equivalent to a INSERT TRIGGER, in order to create a related record in another table. I could do this serially.
Code:
session.save( a );
session.refresh ( a );
B relatedEntity = new B();
relatedEntity.setParent( a );
relatedEntity.setStatus( "foo" );
session.save( relatedEntity );
However, I want something like a post execution method to run once
a has been saved.
How can I achieve this in Hibernate ?
Regards,
Alistair