constructorAnnotations
The additional annotations to be placed on generated constructors.
A repository has one constructor, so most containers inject through it without being
told. This is for the ones that want to be told, or for a project whose style is to say
so anyway — jakarta.inject.Inject, org.springframework.beans.factory.annotation.Autowired.
Configuration Options
Option: ‘jakarta.inject.Inject’
Marks the constructor for injection explicitly:
package com.example.persistence;
import jakarta.inject.Inject;
public final class TenantRepository {
@Inject
public TenantRepository(final DataSource dataSource) {
// ... rest of generated code
}
}
Related Options
Also in this group: methodAnnotations , repositoryAnnotations .
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 --annotations-constructor-annotations=configValue
Gradle
In order to use YoSQL together with Gradle
, take a look at the tooling documentation for Gradle
. The constructorAnnotations setting can be configured using Gradle in Kotlin syntax like this:
plugins {
java
id("wtf.metio.yosql") version "2026.8.8"
}
yosql {
annotations {
constructorAnnotations.set(configValue)
}
}
or in Groovy syntax like this:
plugins {
id "java"
id "wtf.metio.yosql" version "2026.8.8"
}
yosql {
annotations {
constructorAnnotations = configValue
}
}
Maven
In order to use YoSQL together with Maven
, take a look at the tooling documentation for Maven
. The constructorAnnotations 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>
<annotations>
<constructorAnnotations>configValue</constructorAnnotations>
</annotations>
</configuration>
</plugin>
</plugins>
</build>