Reports usages of immutable collections in JPA entities.

Detects properties annotated with @OneToMany or @ManyToMany with immutable collection types (List, Set, Map). Suggests using mutable collection types (MutableList, MutableSet, MutableMap) instead, to ensure Hibernate compatibility.

嵌入代码段:


@Entity
open class User(
  @Id
  val id: Long = 0L,
  @OneToMany
  val orders: List = listOf(),
)
After applying the quickfix:

@Entity
open class User(
  @Id
  val id: Long = 0L,
  @OneToMany
  val orders: MutableList = mutableListOf(),
)