Technology Description: Hibernate annotation- 3.4.0.GA java 1.5
table : users_roles_branches columns : user_id, role_id, branch_id<
My suggestion would be to introduce a new concept in your domain-model RoleAssignment
:
class RoleAssignment {
private User user;
private Branch branch;
private Role role;
}
Entities User
, Branch
and Role
should have 1:N relationship with RoleAssignment
. For eg:
class User {
private Set<RoleAssignment> roleAssignemnts;
}