@RequiresSession
  public HostVersionEntity findHostVersionByHostAndRepository(HostEntity host,
      RepositoryVersionEntity repositoryVersion) {
    TypedQuery<HostVersionEntity> query = entityManagerProvider.get().createNamedQuery(
        "findByHostAndRepository", HostVersionEntity.class);

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

    return daoUtils.selectOne(query);
  }
Gets the {@link HostVersionEntity} associted with the specified host and
repository.

@param host
@param repositoryVersion
@return
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostVersionDAO.java