Skip to content

❓ Processor configuration

The annotation processor can be configured by annotation processor options or by one class, which has the annotation `@JdbcConfig“.

options keysDescriptionDefault
io.kaumei.jdbc.processor.configdefine the config classunset
io.kaumei.jdbc.processor.debugfolderenable/disable auto configurationunset
io.kaumei.jdbc.processor.loglevelthe log levelERROR
  • ❓ If io.kaumei.jdbc.processor.config is set, it must point to the one class which is annotated with @JdbcConfig. This must be the full qualified class name. In any other case the annotation processor throws an exception. It must be set, if your IDE does incremental compiling. See below for more information, what can be configured.
  • ❓ If io.kaumei.jdbc.processor.debugfolder is set the annotation processor dumps its internal state to that folder. This is only useful for debug sessions.
  • io.kaumei.jdbc.processor.loglevel will change the log level. Supported values are: ERROR, WARN, INFO, DEBUG.

In Maven the options can be set like the following example

<compilerArgs>
<arg>-Aio.kaumei.jdbc.processor.config=...</arg>
<arg>-Aio.kaumei.jdbc.processor.debugfolder=...</arg>
<arg>-Aio.kaumei.jdbc.processor.loglevel=...</arg>
</compilerArgs>

The annotation processor can be configured by annotate a type with @JdbcConfig or by an annotation processor option (see above). You can defined the default values for the annotation processor run.

AnnotationDefault
@JdbcBatchSize1000
@JdbcFetchDirectionunset
@JdbcFetchSizeunset
@JdbcMaxRowsunset
@JdbcNoMoreRowsTHROW_EXCEPTION
@JdbcNoRowsTHROW_EXCEPTION
@JdbcQueryTimeoutunset
@JdbcResultSetConcurrencyunset
@JdbcResultSetTypeunset
@JdbcReturnGeneratedValuesGENERATED_KEYS

With @JdbcConfig(parent = ...) one parent configuration can be defined. The annotation processor will go the the first parent and will import all annotations and converter top down to the current. Later will overwrite the former.

  • All static methods with in the configuration type will be treat as converter, if they are annotated with either @JdbcToJava or JavaToJdbc.
  • The annotation @JdbcConfig(converter = {...}) defines global converter.
  • if converter types are referenced, it may have one @JdbcToJava or JavaToJdbc, in this cases the processor will try to register static converter.