Hibernate cascading: should setting to null on a parent delete children?
Posted
by EugeneP
on Stack Overflow
See other posts from Stack Overflow
or by EugeneP
Published on 2010-04-18T08:16:44Z
Indexed on
2010/04/18
8:23 UTC
Read the original article
Hit count: 328
I wonder if Hib works as expected in my case?
My Cascading options are set to "all,delete-orphan".
Table_A @OneToOne Table_B
Table_B @OneToMany Table_C
Now it looks like Table_A . getTable_B . getTable_C_Collection()
Suppose there are elements in Table_C collection.
What I expect from Hibernate: if I set Table_B link to null, then
all Table_C collection elements MUST BE DELETED.
It does not happen. They become ORPHANED !
© Stack Overflow or respective owner