public SQLInsertClause insertOnDuplicateKeyUpdate(RelationalPath<?> entity, Expression<?>... clauses) {
        SQLInsertClause insert = insert(entity);
        StringBuilder flag = new StringBuilder(" on duplicate key update ");
        for (int i = 0; i < clauses.length; i++) {
            flag.append(i > 0 ? ", " : "").append("{").append(i).append("}");
        }
        insert.addFlag(Position.END, ExpressionUtils.template(String.class, flag.toString(), clauses));
        return insert;
    }
Create a INSERT ... ON DUPLICATE KEY UPDATE clause

@param entity table to insert to
@param clauses clauses
@return insert clause
querydsl-sql/src/main/java/com/querydsl/sql/mysql/MySQLQueryFactory.java