Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用Hibernate Panache更新属性?_Java_Hibernate_Kotlin_Quarkus_Quarkus Panache - Fatal编程技术网

Java 如何使用Hibernate Panache更新属性?

Java 如何使用Hibernate Panache更新属性?,java,hibernate,kotlin,quarkus,quarkus-panache,Java,Hibernate,Kotlin,Quarkus,Quarkus Panache,我有以下DDL定义: @Entity data class Interest( @JsonIgnore @ManyToMany(mappedBy = "interests") var account: List<Account> = listOf(), var description: String = "") : PanacheEntity() @Entity data class Account(@fie

我有以下DDL定义:

@Entity
data class Interest(
    @JsonIgnore
    @ManyToMany(mappedBy = "interests")
    var account: List<Account> = listOf(),
    var description: String = "") : PanacheEntity()


@Entity
data class Account(@field:Id var uuid: UUID? = null,
                   @ManyToOne(fetch = FetchType.LAZY) var gender: Gender? = null,
                   var birthday: Long = 0,
                   @ManyToMany(fetch = FetchType.LAZY, cascade = [CascadeType.PERSIST])
                   @JoinTable(
                       name = "account_interests",
                       joinColumns = [JoinColumn(name = "account_id")],
                       inverseJoinColumns = [JoinColumn(name = "interest_id")]
                   )
                   var interests: List<Interest> = listOf()) : PanacheEntityBase
我遇到的问题是方法
updateInterests
。它抛出异常:

RESTEASY002020: Unhandled asynchronous exception, sending back 500: org.jboss.resteasy.spi.ApplicationException: java.lang.IllegalArgumentException: Parameter value [Interest(account=[], description=Luxury)] did not match expected type [java.util.Collection (n/a)]
传入的
兴趣
有效负载为:

[Interest(account=[], description=Luxury), Interest(account=[], description=Travel)]
如何正确更新帐户
利息
的属性

[Interest(account=[], description=Luxury), Interest(account=[], description=Travel)]