java - Add extra processing in hibernate cascaded methods -



java - Add extra processing in hibernate cascaded methods -

how add together processing called whenever cascaded operation such save() called? example, if have thing in database lots of subthings, processing must done before beingness stored (for illustration finding out today's date, , storing in column "create_date") , let's applies every single database entry.

so when save thing (using jackson's objectmapper), has subthings defined in json, create_date beingness null (because don't want client worry that). when save thing, hibernate cascade invoke native hibernate save() on subthings, means though create_date processing done thing, won't done subthings, means database complain subthings don't have create_dates on them.

it trivial hibernate interceptors (org.hibernate.emptyinterceptor). here's example:

hibernate interceptor illustration - audit log

java hibernate jackson

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -