@SuppressWarnings("unchecked")
    @Override
    public T fetchOne() throws NonUniqueResultException {
        try {
            return (T) createQuery(false).uniqueResult();
        } catch (org.hibernate.NonUniqueResultException e) {
            throw new NonUniqueResultException(e);
        }
    }
Abstract base class for Hibernate Search query classes

@param <T> result type
@param <Q> concrete subtype
querydsl-hibernate-search/src/main/java/com/querydsl/hibernate/search/AbstractSearchQuery.java