sourceDirectory
The directory holding the Java sources of types referenced by SQL statements.
Naming a record as the resultRowType of a statement makes YoSQL read that record’s source to
learn its component names and types. The source is looked up under this directory, at the path
its package implies, so a record com.example.Tenant is expected in <sourceDirectory>/com/example/Tenant.java.
Nothing is loaded or executed while reading — the record is parsed as text, at build time, before
it has been compiled. That is what lets the generated converter be plain resultSet.getX(...)
calls with no reflection left at runtime.
Configuration Options
Option: ‘src/main/java’
The default value of the sourceDirectory configuration option used by the Gradle- and Maven-tooling is src/main/java, the directory those tools compile from.
Option: ‘.’
The default value of the sourceDirectory configuration option used by the Ant- and CLI-tooling is . - the current directory.
Option: ‘src/main/domain’
Changing the sourceDirectory configuration option to src/main/domain makes YoSQL look for resultRowType records under that directory instead.
Related Options
Also in this group: inputBaseDirectory , outputBaseDirectory , skipLines , sqlFilesCharset , sqlFilesSuffix , sqlStatementSeparator .
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 --files-source-directory=configValue
As long as the name of the config option is unique across all configuration groups, you can use the shorter form:
yosql --source-directory=configValue
Gradle
In order to use YoSQL together with Gradle
, take a look at the tooling documentation for Gradle
. The sourceDirectory setting can be configured using Gradle in Kotlin syntax like this:
plugins {
java
id("wtf.metio.yosql") version "2023.2.22"
}
yosql {
files {
sourceDirectory.set(configValue)
}
}
or in Groovy syntax like this:
plugins {
id "java"
id "wtf.metio.yosql" version "2023.2.22"
}
yosql {
files {
sourceDirectory = configValue
}
}
Maven
In order to use YoSQL together with Maven
, take a look at the tooling documentation for Maven
. The sourceDirectory 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>
<files>
<sourceDirectory>configValue</sourceDirectory>
</files>
</configuration>
</plugin>
</plugins>
</build>