@Override
    public List<SQLBindings> getSQL() {
        if (batches.isEmpty()) {
            SQLSerializer serializer = createSerializer();
            serializer.serializeMerge(metadata, entity, keys, columns, values, subQuery);
            return Collections.singletonList(createBindings(metadata, serializer));
        } else {
            List<SQLBindings> builder = new ArrayList<>();
            for (SQLMergeBatch batch : batches) {
                SQLSerializer serializer = createSerializer();
                serializer.serializeMerge(metadata, entity, batch.getKeys(), batch.getColumns(), batch.getValues(), batch.getSubQuery());
                builder.add(createBindings(metadata, serializer));
            }
            return CollectionUtils.unmodifiableList(builder);
        }
    }
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