@Nullable
    private Object uniqueResult(Query query) {
        try {
            return getSingleResult(query);
        } catch (javax.persistence.NoResultException e) {
            logger.log(Level.FINEST, e.getMessage(),e);
            return null;
        } catch (javax.persistence.NonUniqueResultException e) {
            throw new NonUniqueResultException(e);
        } finally {
            reset();
        }
    }
Transforms results using FactoryExpression if ResultTransformer can't be used

@param query query
@return single result
querydsl-jpa/src/main/java/com/querydsl/jpa/sql/AbstractJPASQLQuery.java