injectConverter
Whether this statement’s converter is a constructor parameter of its repository.
A generated converter is constructed with no arguments, so a mapper that has to close over something — a resolver, a tenant key, a clock — cannot be one. The way out is to write the converter yourself and have the repository take it, which is what injectConverters does for every repository in the project at once. In a project with dozens of them already wired up by hand, changing every constructor for the sake of one statement is not a trade worth making.
Set this on the statement instead and only that converter is injected. The repository it belongs to takes one more constructor parameter; every other repository is generated exactly as before.
Statements sharing a converter share its field, so one of them asking is enough for it to be injected — there is one field and it is initialised once. The converter needs an alias, since that is what names the parameter.
Related Options
Also in this group: annotations , catchAndRethrow , createConnection , description , executeBatch , executeOnce , generateConnectionOverloads , generateResultRowType , name , parameters , repository , resultRowColumns , resultRowConverter , resultRowType , returningMode , throwOnMultipleResults , type , validateSchema , vendor , writesReturnUpdateCount .
Front Matter
In order to configure this option, place the following code in the front matter of your SQL statement:
-- injectConverter: true
SELECT something
FROM your_database_schema
WHERE some_column = :some_value