executeBatch
Generate methods that are executed as batch
A second method taking an array per parameter, adding a batch entry per element and
answering with the int[] the driver gives back. One round trip instead of one per row,
which is the difference between an import that takes a minute and one that takes an hour.
Only writing statements get one — batching a query would have nowhere to put the results. Turn it off for a statement that is never run in bulk, if the extra method bothers you; it costs nothing to leave on.
The method is called what the statement is called plus Batch, which is what lets
insertTenant and insertTenantBatch sit in the same repository.
Configuration Options
Option: ’true'
The default. A batch method sits alongside the single-row one:
public final class TenantRepository {
public int insertTenant(final UUID id, final String slug) {
// ... rest of generated code
}
public int[] insertTenantBatch(final UUID[] id, final String[] slug) {
// ... rest of generated code
}
}
Option: ‘false’
No batch method is generated:
public final class TenantRepository {
public int insertTenant(final UUID id, final String slug) {
// ... rest of generated code
}
}
Related Options
Also in this group: allowedCallPrefixes , allowedReadPrefixes , allowedWritePrefixes , basePackageName , catchAndRethrow , createConnection , executeOnce , generateConnectionOverloads , generateInterfaces , injectConverters , throwOnMultipleResults , validateMethodNamePrefixes , writesReturnUpdateCount .
Tooling
Ant
In order to use YoSQL together with Ant
, take a look at the tooling documentation for Ant
.
Bazel
In order to use YoSQL together with Bazel
, take a look at the tooling documentation for Bazel
.
CLI
In order to use YoSQL on the command line, take a look at the tooling documentation for CLI
.
yosql generate --repositories-execute-batch=configValue
Gradle
In order to use YoSQL together with Gradle
, take a look at the tooling documentation for Gradle
. The executeBatch setting can be configured using Gradle in Kotlin syntax like this:
plugins {
java
id("wtf.metio.yosql") version "2026.8.8"
}
yosql {
repositories {
executeBatch.set(configValue)
}
}
or in Groovy syntax like this:
plugins {
id "java"
id "wtf.metio.yosql" version "2026.8.8"
}
yosql {
repositories {
executeBatch = configValue
}
}
Maven
In order to use YoSQL together with Maven
, take a look at the tooling documentation for Maven
. The executeBatch setting can be configured using Maven like this:
<build>
<plugins>
<plugin>
<groupId>wtf.metio.yosql.tooling</groupId>
<artifactId>yosql-tooling-maven</artifactId>
<version>2026.8.8</version>
<configuration>
<repositories>
<executeBatch>configValue</executeBatch>
</repositories>
</configuration>
</plugin>
</plugins>
</build>