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

    ClusterStateEntity that = (ClusterStateEntity) o;

    if (clusterId != null ? !clusterId.equals(that.clusterId) : that.clusterId != null) {
      return false;
    }

    if (currentClusterState != null
        ? !currentClusterState.equals(that.currentClusterState) : that.currentClusterState != null) {
      return false;
    }

    if (currentStack != null ? !currentStack.equals(that.currentStack)
        : that.currentStack != null) {
      return false;
    }

    return true;
  }
Unidirectional one-to-one association to {@link StackEntity}
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterStateEntity.java