Hello,
When I save the Item, it will not update the FUNCTIONITEM_ROLE_LINK table !!!!
Best regards,
Eric
Code:
class Item {
@ManyToMany
@JoinTable(table = @Table(name = "FUNCTIONITEM_ROLE_LINK"), joinColumns = { @JoinColumn(name = "item_id") }, inverseJoinColumns = { @JoinColumn(name = "role_id") })
List<Role> roles;
/**
* @param roles
* The roles to set.
*/
public void setRoles(List<UserRole> roles) {
this.roles = roles;
}
@Transient
public void addRole(UserRole role) {
roles.add(role);
}
}
and I add the Item as following :
Code:
Item newItem = new Item();
newItem.setActionPage("#new");
newItem.setLabel("New");
newItem.addRole(UserDelegate.getRole("user"));