@SuppressWarnings("unchecked")
    @Override
    @Nullable
    public T fetchOne() throws NonUniqueResultException {
        if (getMetadata().getModifiers().getLimit() == null) {
            limit(2);
        }
        Query query = createQuery(false);
        Object rv = execute(query, false);
        if (rv instanceof List) {
            List<?> list = (List<?>) rv;
            if (!list.isEmpty()) {
                if (list.size() > 1) {
                    throw new NonUniqueResultException();
                }
                return (T) list.get(0);
            } else {
                return null;
            }
        } else {
            return (T) rv;
        }
    }
Close the query and related resources
querydsl-jdo/src/main/java/com/querydsl/jdo/sql/AbstractSQLQuery.java