-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: removing objects from associative set on delete()
PostPosted: Thu Aug 03, 2006 11:23 am 
Newbie

Joined: Wed Aug 02, 2006 11:30 am
Posts: 7
Let's use the example of departments within a company. A particular employee can be a member of more than one department.

So, I have a unidirectional many-to-many association where each department contains a set of employees.

When an employee is deleted, I want him deleted from any department(s) that he may be associated with. This is resulting in an "integrity constraint violation" with respect to the association table.

I assume I can configure hibernate to make this work for me. Note that I do not want the deletion of a department to result in the deletion of all employees in the department; the life cycles of the 2 objects are independent.

I have looked at the cascade attribute, but I don't see a value that does what I need.

Is the solution to make the association bi-directional? Is there some other way?

Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.