Bulking
Writing bulk queries in jOOQ is just a matter of using the jOOQ DSL API. For instance, a bulk insert SQL looks like this:
INSERT IGNORE INTO `classicmodels`.`order` ( `order_date`, `required_date`, `shipped_date`, `status`, `comments`, `customer_number`, `amount`) VALUES (?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?)
This can be expressed in jOOQ by chaining the values()
call:
ctx.insertInto(ORDER) .columns(ORDER.ORDER_DATE, ORDER.REQUIRED_DATE, ORDER.SHIPPED_DATE, ORDER.STATUS, ORDER.COMMENTS,ORDER.CUSTOMER_NUMBER, ORDER.AMOUNT) .values(LocalDate.of(2004,10,22), LocalDate.of(2004,10,23), LocalDate...