Есть Entity с первичным ключем типа Long ``` class...
# russian
k
Есть Entity с первичным ключем типа Long
Copy code
class Identifiable {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "id_seq")
    @SequenceGenerator(name = "id_seq", sequenceName = "id_seq", allocationSize = 1)
    var id: Long? = null

    override fun toString(): String {
        return "Identifiable{id=$id}"
    }
}
Пытаюсь построить запрос
Copy code
entityManager.createQuery("select i.id from Identifiable i", Long::class.java)
При запуске оно ругается
Copy code
Exception in thread "main" java.lang.IllegalArgumentException: Type specified for TypedQuery [long] is incompatible with query return type [class java.lang.Long]
Как правильно бороться с таким?
google 2
3