Installation
Requirements
Section titled “Requirements”Kaumei JDBC supports Java 17 or newer. Your project also needs:
- a JDBC driver for your database
- annotation processing enabled in your build or IDE
Artifacts
Section titled “Artifacts”Use the same Kaumei JDBC version for all artifacts.
| Artifact | Role | Where it belongs |
|---|---|---|
io.kaumei.jdbc:jdbc-annotation | Annotations used in your source code. | Compile time |
io.kaumei.jdbc:jdbc-core | Runtime API used by generated code. | Compile time and runtime |
io.kaumei.jdbc:jdbc-processor | Annotation processor. | Annotation processor path |
Maven example
Section titled “Maven example”The Maven example below shows the required dependency roles.
<properties> <kaumei-jdbc.version>develop-SNAPSHOT</kaumei-jdbc.version></properties><dependencies> <dependency> <groupId>io.kaumei.jdbc</groupId> <artifactId>jdbc-annotation</artifactId> <version>${kaumei-jdbc.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>io.kaumei.jdbc</groupId> <artifactId>jdbc-core</artifactId> <version>${kaumei-jdbc.version}</version> </dependency></dependencies>Configure the annotation processor path:
<plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <annotationProcessorPaths> <path> <groupId>io.kaumei.jdbc</groupId> <artifactId>jdbc-processor</artifactId> <version>${kaumei-jdbc.version}</version> </path> </annotationProcessorPaths> <compilerArgs> <arg>-Aio.kaumei.jdbc.processor.config=io.kaumei.jdbc.spec.ConfigSpec</arg> </compilerArgs> </configuration></plugin>Other build tools
Section titled “Other build tools”Use the same dependency roles with other build tools:
- add
jdbc-annotationfor compilation - add
jdbc-corefor compilation and runtime - add
jdbc-processorto the annotation processor path
Do not put jdbc-processor on the application runtime classpath unless your
build tool requires that internally.
IntelliJ IDEA
Section titled “IntelliJ IDEA”When importing a project, make sure annotation processing is enabled.
Open Build, Execution, Deployment > Compiler > Annotation Processors
and tick Enable annotation processing.