>> One of the nice things about .store() is that it decides whether to insert >> or update automatically, is this possible using a syntax that is compatible >> with .batch()? > > The idea would be to handle that in Factory.batchStore(TableRecord<?>...);
Factory.batchStore(UpdatableRecord<?>...) is added and pushed to GitHub. It will be available in jOOQ 2.3.0. It has two operation modes, similar to the other batch operations, which can be controlled through the Factory's Settings: StatementType.PREPARED_STATEMENT: ----------------------------------------------------------- The batch statement generates SQL from the various records using bind variables. Each distinct rendered SQL statement will cause a distinct batch operation. - Best case: 1 batch operation and n bind value sets - Worst case: n batch operations and 1 bind value set per batch operation StatementType.STATIC_STATEMENT: ----------------------------------------------------------- The batch statement generates SQL from the various records using inlined bind variables. All of these statements can be executed in a single batch operation. I think this solution is more or less optimal. It'll give client code full control over what is going to be executed. Cheers Lukas
