@Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    ResourceEntity that = (ResourceEntity) o;

    return !(id != null ? !id.equals(that.id) : that.id != null) && !(resourceType != null ?
        !resourceType.equals(that.resourceType) : that.resourceType != null);

  }
Set the associated privileges.

@param privileges the privileges
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ResourceEntity.java