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

python - How to clone or copy a list? -

The SDK directory does not exist (ubuntu 16.04) (react native) -

python - How to use Celery in Tornado with redis as broker and backend? -