@Override
  public boolean equals(Object object) {
    if (this == object) {
      return true;
    }

    if (object == null || getClass() != object.getClass()) {
      return false;
    }

    AlertDefinitionEntity that = (AlertDefinitionEntity) object;

    // use the unique ID if it exists
    if( null != definitionId ){
      return Objects.equals(definitionId, that.definitionId);
    }

    return Objects.equals(definitionId, that.definitionId) &&
        Objects.equals(clusterId, that.clusterId) &&
        Objects.equals(definitionName, that.definitionName);
  }
Gets the equality to another historical alert entry based on the following criteria:
<ul>
<li>{@link #definitionId}
<li>{@link #clusterId}
<li>{@link #definitionName}
</ul>
<p/>
However, since we're guaranteed that {@link #definitionId} is unique among persisted entities, we
can return the hashCode based on this value if it is set.
<p/>
{@inheritDoc}
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertDefinitionEntity.java