示例#1
0
文件: User.java 项目: scubasam/ERS
  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);
  }
示例#2
0
文件: User.java 项目: scubasam/ERS
  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);
  }
示例#3
0
文件: Role.java 项目: scubasam/ERS
  public boolean equals(Role otherRole) {
    if (otherRole == null) return false;

    if (this.getRole().equals(otherRole.getRole())) return true;
    else return false;
  }