may be simple question, but anyway:
I have "1 to n" relationship between A and B objects.
I get ma A from EntityManager, I call getBs() which
give me a Collection of Bs. Now I remove one B from
Collection (iterator.remove()) and call merge on A.
I would like to see that B I have removed in code will be
deleted from DB. Is this right or completely wrong?
Thanks a lot
This has been discussed quite a few times before. See:
In summary, you must remove the B entity from the collection within A, and invoke em.remove(b) also.
The other alternative is to use a Hibernate specific annotation.