try {record.insert();}catch (DataAccessException e) {// Perhaps, check e's cause to be a SQLIntegrityConstraintViolationExceptionrecord.update();}
DSL.using(configuration).insertInto(TABLE)
.set(record)
.onDuplicateKeyUpdate()
.set(record)
.execute();
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Note the set(record) methods are convenience methods to copy all (changed) values from your record into the statement. If you're not using MySQL or MariaDB, the above statement will still work on all of those databases that support the SQL standard MERGE statement.
Note the set(record) methods are convenience methods to copy all (changed) values from your record into the statement. If you're not using MySQL or MariaDB, the above statement will still work on all of those databases that support the SQL standard MERGE statement.IMPRESSIVE!
It always annoys me when people say they MUST use MySQL because it has UPSERT...
UPSERT is STUPID, but implementing that capability using a SQL standard like MERGE is VERY NICE!
--