Skip to content

Access Kotlin Jooq generated sources in JAVA

I am using Jooq 3.14.7 version to generate Kotlin sources. My code base has both Java and Kotlin class and we are transitioning to Kotlin.

I am able to access Jooq sources in Kotlin class like below (FetchBooks.kt)



But in Java classes I have to go like this below (

import static;


This seems a pretty messy way in Java. Any suggestions?


You could patch the code generator to generate some annotations, such as @JvmField for your various properties. There’s currently no hook for such annotations, so this doesn’t work out of the box. Patching will be necessary (or copy pasting the implementation of JavaGenerator::generateTable and patching only that).

However, I suggest generating your jOOQ code with the JavaGenerator until your code base is migrated completely to kotlin.