Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Crosstables and Composite Primary Keys

Hi,

I've found a strange problem with EclipseLink 2.1.1. I've got two classes, roles and actions, each action has a set of roles (and via versa, mapped by the actions). In the db, this is a cross table action_roles (role_id, action_id), where both fields toegether form the primary key. Both ManyToMany relations are FetchType.LAZY, using FetchType.EAGER is not an option (because of performance issues).

Now when I try to add an action to a role, I always get an Duplicate Key exception, as the action is already in the set. This should not be a problem, as the equals() and hashcode() methods are both overwritten, so that the role should not be twice inside the set (and it isn't, I checked).

Another aspect of the problem is, that it seems to occur only since I updated to 2.1.1, before the problem didn't occur and the code where is happens hasn't change since then.

Anyone has an idea what the reason could be? I will do some more tests tomorrow, perhaps I'll find a more specific test case.

Regard,

Flo


Back to the top