Kotlin: Collection has neither generic type or OneToMany.targetEntity()

Have you tried changing

var roles: Set<RoleType>? = null

to

var roles: MutableSet<RoleType>? = null

If you have a look at the interface definition of Set, you’ll see it’s defined as public interface Set<out E> : Collection<E> whereas MutableSet is defined as public interface MutableSet<E> : Set<E>, MutableCollection<E>

Set<out E> ‘s Java equivalent I believe is Set<? extends E> instead of what you were looking for Set<E>.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)