I think I know why this is happening. As far as I can remember, when
we introduced the keys, i remember rechecking the relationships.
However, what I missed was something along the lines:
Set<Key> list = ....
public void remove(ModelClass object) {
this.list.remove(obj);
}
The above code will not work as Matt mentioned the other day. Key ==
Key will fail since the references are different. AFAIK list.remove()
removes an object by reference.
I think what's needed here is to loop through (not using for each
case) and check IDs and remove appropriately.
We can have a common method to handle this (parameters being a set of
keys and a key) since this would be used in many cases.
I think I know why this is happening. As far as I can remember, when
we introduced the keys, i remember rechecking the relationships.
However, what I missed was something along the lines:
Set<Key> list = ....
public void remove(ModelClass object) {
this. list.remove( obj);
}
The above code will not work as Matt mentioned the other day. Key ==
Key will fail since the references are different. AFAIK list.remove()
removes an object by reference.
I think what's needed here is to loop through (not using for each
case) and check IDs and remove appropriately.
We can have a common method to handle this (parameters being a set of
keys and a key) since this would be used in many cases.
--
*Prageeth Silva*