如何限制实体中的列表/集合?
我有ProfileEntity:
@Entity
@Table(name = "profiles")
class Profile {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
var id: Long = 0
...
@ManyToMany(cascade = [(CascadeType.ALL)])
@JoinTable(name = "subscriptions", ...)
var subscriptions: Set<Profile> = emptySet()
}
如何限制套装? @Size注释不起作用。