@RequiresSession
  public List<HostComponentStateEntity> findByServiceAndComponentAndNotVersion(String serviceName,
      String componentName, String version) {

    final TypedQuery<HostComponentStateEntity> query = entityManagerProvider.get().createNamedQuery(
        "HostComponentStateEntity.findByServiceAndComponentAndNotVersion", HostComponentStateEntity.class);

    query.setParameter("serviceName", serviceName);
    query.setParameter("componentName", componentName);
    query.setParameter("version", version);

    return daoUtils.selectList(query);
  }
@param serviceName
@param componentName
@param version
@return a list of host components whose version that does NOT match the give version
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java