@RequiresSession
  public List<HostVersionEntity> findByClusterHostAndState(String  clusterName, String hostName, RepositoryVersionState state) {
    final TypedQuery<HostVersionEntity> query = entityManagerProvider.get()
        .createNamedQuery("hostVersionByClusterHostnameAndState", HostVersionEntity.class);
    query.setParameter("clusterName", clusterName);
    query.setParameter("hostName", hostName);
    query.setParameter("state", state);

    return daoUtils.selectList(query);
  }
Retrieve all of the host versions for the given cluster name, host name, and state. <br/>
@param clusterName Cluster name
@param hostName FQDN of host
@param state repository version state
@return Return all of the host versions that match the criteria.
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostVersionDAO.java