开发者

I want to delete record(s) from child table after calling save/update on parent using hibernate

开发者 https://www.devze.com 2023-01-09 21:29 出处:网络
I want to delete record(s)from child table aft开发者_如何学JAVAer calling save/update on parent using hibernate.Using an interceptor or callbacks methods would probably be the best place to implement

I want to delete record(s) from child table aft开发者_如何学JAVAer calling save/update on parent using hibernate.


Using an interceptor or callbacks methods would probably be the best place to implement this. I'm not sure if you are using straight Hibernate or JPA so I'll provide both links:

  • Chapter 12. Interceptors and events in Hibernate Core Reference Guide
  • Chapter 6. Entity listeners and Callback methods in Hibernate EM Reference Guide

Basically, the idea would be to set the child collection to null during pre-update.

0

精彩评论

暂无评论...
验证码 换一张
取 消