jpa - Orphan removel behaving weirdly , removing the other child records too -


orphan removel removes child records, removing needed child records example if customer has 3 orders a, b, c , if customer removes order c , adds order d after merging have 1 order d. a, b got removed, before merging see list size 3, missing here

@onetomany(mappedby = "lgrule", orphanremoval = true, cascade = cascadetype.all) private list<lgarrangment> lgarrangements; 

and child table

@entity @table(name = "lg_arrangement") public class lgarrangement implements serializable { private static final long serialversionuid = 1l; @embeddedid private lgarrangementpk id;  // bi-directional many-to-one association lgrule @manytoone @joincolumn(name = "lg_rule_id") private lgrule lgrule;  ... 

any insights helpfull, thanks


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -