Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.3.0ga
Name and version of the database you are using:
mySQL 5.0.27
Hi,
I have a parent object with a set of <composite-element> children, with cascade="all, delete-orphan"
I have a filter on the collection that limits the collection to items based on the current user and their location, so the collection only has 1 element most of the time.
When I remove this element from the collection and save to the db, Hibernate removes all items from the db, probably because the collection is now empty. It does a delete from ... where id = ...
This ends up deleting records for other users and locations.
What is the recommended way to handle this?
Thanks!