kotlin-jpa插件未生成默认构造函数 [英] kotlin-jpa plugin not generating default constructor
本文介绍了kotlin-jpa插件未生成默认构造函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用kotlin-jpa为我的kotlin实体生成默认构造函数,但是并没有生成:
I am using kotlin-jpa to generate default constructor to my kotlin entity, however, does are not being generated:
我刚刚使用过:
id("org.jetbrains.kotlin.plugin.jpa") version "1.3.21"
@Entity
data class PlanSubscription(@Id ...
但是带有kotlin-jpa插件的事件不会生成构造函数:
But event with the kotlin-jpa plugin the constructor is not generated:
No default (no-argument) constructor for class
推荐答案
我有一个非常相似的问题.尽管不使用数据类的建议可能有用,也可能不有用,但我发现使用的是jpa插件版本,请尝试使用1.3.41
I had a very similar issue. While the advice of not using data classes may or may not be a useful one I found that it was the version of the jpa plugin that was at issue try using version 1.3.41
id "org.jetbrains.kotlin.plugin.jpa" version "1.3.41"
这篇关于kotlin-jpa插件未生成默认构造函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文