首页 > 解决方案 > Jooq kotlin 枚举类型

问题描述

kotlin 中有没有办法让枚举类扩展 Jooq 的EnumType

我得到一个编译错误,因为 EnumType 有一个抽象的 getName 方法,Kotlin 枚举类也是如此。

Error:(96, 5) Kotlin: Inherited platform declarations clash: The following declarations have the same JVM signature (getName()Ljava/lang/String;):
    fun <get-name>(): String defined in com.xyz.MyEnum.Val1
    fun getName(): String defined in com.xyz.MyEnum.Val1

如果我使用常规的 Kotlin 类而不是 enum 类,那么 Jooq 会失败并出现错误:

Error while looking up Scala enum
ClassNotFoundException ...

Jooq + Kotlin + Postgresql Enums 能很好地发挥作用吗?

标签: postgresqlkotlinjooq

解决方案


推荐阅读