@RequiresSession
  public List<HostVersionEntity> findHostVersionByClusterAndRepository(long clusterId,
      RepositoryVersionEntity repositoryVersion) {
    TypedQuery<HostVersionEntity> query = entityManagerProvider.get().createNamedQuery(
        "findHostVersionByClusterAndRepository", HostVersionEntity.class);

    query.setParameter("clusterId", clusterId);
    query.setParameter("repositoryVersion", repositoryVersion);

    return daoUtils.selectList(query);
  }
Gets all host version entities assocaited with the specified cluster and
repository.

@param clusterId
         the cluster ID.
@param repositoryVersion
         the repository (not {@code null}).
@return the host versions.
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostVersionDAO.java