@SuppressWarnings("unchecked")
    @Override
    public List<T> fetch() {
        Expression<T> expr = (Expression<T>) queryMixin.getMetadata().getProjection();
        SQLListenerContextImpl context = startContext(connection(), queryMixin.getMetadata());
        String queryString = null;
        List<Object> constants = Collections.emptyList();

        try {
            listeners.preRender(context);
            SQLSerializer serializer = serialize(false);
            queryString = serializer.toString();
            logQuery(queryString, serializer.getConstants());
            context.addSQL(getSQL(serializer));
            listeners.rendered(context);

            listeners.notifyQuery(queryMixin.getMetadata());
            constants = serializer.getConstants();

            listeners.prePrepare(context);
            try (PreparedStatement stmt = getPreparedStatement(queryString)) {
                setParameters(stmt, constants, serializer.getConstantPaths(), queryMixin.getMetadata().getParams());
                context.addPreparedStatement(stmt);
                listeners.prepared(context);

                listeners.preExecute(context);
                try (ResultSet rs = stmt.executeQuery()) {
                    listeners.executed(context);
                    lastCell = null;
                    final List<T> rv = new ArrayList<T>();
                    if (expr instanceof FactoryExpression) {
                        FactoryExpression<T> fe = (FactoryExpression<T>) expr;
                        while (rs.next()) {
                            if (getLastCell) {
                                lastCell = rs.getObject(fe.getArgs().size() + 1);
                                getLastCell = false;
                            }
                            rv.add(newInstance(fe, rs, 0));
                        }
                    } else if (expr.equals(Wildcard.all)) {
                        while (rs.next()) {
                            Object[] row = new Object[rs.getMetaData().getColumnCount()];
                            if (getLastCell) {
                                lastCell = rs.getObject(row.length);
                                getLastCell = false;
                            }
                            for (int i = 0; i < row.length; i++) {
                                row[i] = rs.getObject(i + 1);
                            }
                            rv.add((T) row);
                        }
                    } else {
                        while (rs.next()) {
                            if (getLastCell) {
                                lastCell = rs.getObject(2);
                                getLastCell = false;
                            }
                            rv.add(get(rs, expr, 1, expr.getType()));
                        }
                    }
                    return rv;
                } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) {
                    onException(context, e);
                    throw new QueryException(e);
                } catch (SQLException e) {
                    onException(context, e);
                    throw configuration.translate(queryString, constants, e);
                }
            }
        } catch (SQLException e) {
            onException(context, e);
            throw configuration.translate(queryString, constants, e);
        } finally {
            endContext(context);
            reset();
        }
    }
Get the results as a JDBC ResultSet

@return results as ResultSet
querydsl-sql/src/main/java/com/querydsl/sql/AbstractSQLQuery.java