@RequiresSession
  public ClusterEntity findByName(String clusterName) {
    TypedQuery<ClusterEntity> query = entityManagerProvider.get().createNamedQuery("clusterByName", ClusterEntity.class);
    query.setParameter("clusterName", clusterName);
    try {
      return query.getSingleResult();
    } catch (NoResultException ignored) {
      return null;
    }
  }
Looks for Cluster by ID
@param id ID of Cluster
@return Found entity or NULL
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterDAO.java