defaultConverter
The fully-qualified name of the converter to use for statements that name none.
A converter is named by its class and nothing else: YoSQL reads the class to find its
single public method taking a ResultSet, and that method’s name and return type become
the method the repository calls and the type each row becomes. The field the repository
injects it into is named after the class, with a lower-case first letter.
Leave this empty and statements that name neither a converter nor a resultRowType fall back to the generated ToMap converter .
Configuration Options
Option: ''
The default value of the defaultConverter configuration option is empty, which leaves the generated ToMap converter in place.
Option: ‘com.example.persistence.converter.ToUserConverter’
Setting the defaultConverter configuration option to com.example.persistence.converter.ToUserConverter makes every statement that names no converter of its own return whatever that converter’s ResultSet method returns.
Related Options
Also in this group: generateMapConverter , mapConverterAlias , mapConverterClass , mapConverterMethod , recordConverterMethod , recordConverterPrefix , recordConverterSuffix .
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 --converter-default-converter=configValue
As long as the name of the config option is unique across all configuration groups, you can use the shorter form:
yosql --default-converter=configValue
Gradle
In order to use YoSQL together with Gradle
, take a look at the tooling documentation for Gradle
. The defaultConverter setting can be configured using Gradle in Kotlin syntax like this:
plugins {
java
id("wtf.metio.yosql") version "2023.2.22"
}
yosql {
converter {
defaultConverter.set(configValue)
}
}
or in Groovy syntax like this:
plugins {
id "java"
id "wtf.metio.yosql" version "2023.2.22"
}
yosql {
converter {
defaultConverter = configValue
}
}
Maven
In order to use YoSQL together with Maven
, take a look at the tooling documentation for Maven
. The defaultConverter setting can be configured using Maven like this:
<build>
<plugins>
<plugin>
<groupId>wtf.metio.yosql</groupId>
<artifactId>yosql-tooling-maven</artifactId>
<version>2023.2.22</version>
<configuration>
<converter>
<defaultConverter>configValue</defaultConverter>
</converter>
</configuration>
</plugin>
</plugins>
</build>