I have an entity called Department. Department has a collection of Students.
Student is another entity.
I work with Students only via a Department object. I get a Department with all its Students, I work with it (edit, delete, add Students) and then merge it back. This works well when the objects are all managed.
I have to make a web service that does exactly the same.
The web service has to have all the CRUD operations on a Department.
createDepartment
updateDepartment
getDepartment
deleteDepartment.
Everything works fine.
Except for a slight problem: If I get a department, remove a single user, and then update it - nothing happens, the Student is not deleted.
I guess it has something to do with the objects being disconnected/unmanaged.
How do I fix that?
|