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

    HostVersionEntity other = (HostVersionEntity) obj;
    if (!Objects.equals(id, other.id)) {
      return false;
    }
    if (hostEntity != null ? !hostEntity.equals(other.hostEntity) : other.hostEntity != null) {
      return false;
    }
    if (repositoryVersion != null ? !repositoryVersion.equals(other.repositoryVersion) : other.repositoryVersion != null) {
      return false;
    }
    if (state != other.state) {
      return false;
    }
    return true;
  }
This constructor is mainly used by the unit tests in order to construct an object without the id.
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostVersionEntity.java