2 ms·
I realize you probably can't switch languages, but in a past Kotlin project I was able to get jOOQ working nicely with Kotlin's inline classes [0] as the primar
by lolinder 3y ago
I realize you probably can't switch languages, but in a past Kotlin project I was able to get jOOQ working nicely with Kotlin's inline classes [0] as the primary keys. I can't remember exactly how I did it and don't have access to the code any more (I might have used extension functions somehow?), but it was exactly as nice as you'd expect—no risk of mixing up keys between different tables.
On further investigation, jOOQ actually has a feature which automatically generates PK classes, but it's not in the open source edition. It should, however, be possible to write your own extension that does something similar: https://www.jooq.org/doc/latest/manual/code-generation/codegen-embeddable-types/codegen-embedded-keys/ https://www.jooq.org/doc/latest/manual/code-generation/codeg...
[0] https://kotlinlang.org/docs/inline-classes.html https://kotlinlang.org/docs/inline-classes.html