protected PreparedStatement prepareStatementAndSetParameters(SQLSerializer serializer,
            boolean withKeys) throws SQLException {
        listeners.prePrepare(context);

        queryString = serializer.toString();
        constants = serializer.getConstants();
        logQuery(logger, queryString, constants);
        PreparedStatement stmt;
        if (withKeys) {
            String[] target = new String[keys.size()];
            for (int i = 0; i < target.length; i++) {
                target[i] = ColumnMetadata.getName(getKeys().get(i));
            }
            stmt = connection().prepareStatement(queryString, target);
        } else {
            stmt = connection().prepareStatement(queryString);
        }
        setParameters(stmt, serializer.getConstants(), serializer.getConstantPaths(), metadata.getParams());
        context.addPreparedStatement(stmt);
        listeners.prepared(context);

        return stmt;
    }
Execute the clause and return the generated keys as a ResultSet

@return result set with generated keys
querydsl-sql/src/main/java/com/querydsl/sql/dml/SQLMergeClause.java