Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hibernate interceptor post save?

i need to intercept post save for an entity in hibernate, but all what i found was on save, which is dealing with the entity before being saved, and there's a postFlush method which return a huge lazy iterator, that i can't understand how to use it, please suggest me a way to catch entity after hibernate save or update,

Regards,

like image 671
Amr Faisal Avatar asked Sep 03 '25 04:09

Amr Faisal


1 Answers

postFlush is what you want. The iterator will let you loop through all of the entities that were inserted or updated. It gets called after the sql has executed in the database.

like image 108
Brian Deterling Avatar answered Sep 04 '25 23:09

Brian Deterling