protected PreparedStatement createStatement(boolean withKeys) throws SQLException {
        listeners.preRender(context);
        SQLSerializer serializer = createSerializer();
        if (subQueryBuilder != null) {
            subQuery = subQueryBuilder.select(values.toArray(new Expression[0])).clone();
            values.clear();
        }

        if (!batches.isEmpty() && batchToBulk) {
            serializer.serializeInsert(metadata, entity, batches);
        } else {
            serializer.serializeInsert(metadata, entity, columns, values, subQuery);
        }
        context.addSQL(createBindings(metadata, serializer));
        listeners.rendered(context);
        return prepareStatementAndSetParameters(serializer, withKeys);
    }
Execute the clause and return the generated key with the type of the
given path. If no rows were created, or the referenced column is not a
generated key, null is returned. Otherwise, the key of the first row is
returned.

@param <T>
@param path path for key
@return generated keys
querydsl-sql/src/main/java/com/querydsl/sql/dml/AbstractSQLInsertClause.java