Exemple #1
0
  public void removeRole(Role role, RoleDao dao) {
    if (this.roles == null) this.roles = new HashSet<Role>();

    this.roles.remove(role);
    role.removeUser(this);
    dao.update(role);
  }
Exemple #2
0
  public void addRole(Role role, RoleDao dao) {
    if (this.roles == null) this.roles = new HashSet<Role>();

    this.roles.add(role);
    role.addUser(this);
    dao.update(role);
  }