I have a JPA query which is similar to
TypedQuery<Issue> query = entityManager.createQuery(
"""
Select id, version, ocurrance, description
FROM issue
""", Issue.class);
Where as Issue
type looks like
public class Issue{
... //field definition
public Issue(UUID id, short version, Instant occurrance, String description){
... // field assigning
}
When executing the query, I do get a NoSuchMethodException
telling me that hibernate could not map to the Issue type due a missing constructor definition of Issue.<init>(java.util.UUID,java.lang.Short,java.time.Instant,java.lang.String)
In other words, hibernate seems not to be able to do unboxing, which I find odd.
Can I somehow force unboxing or is this really a limitation with hibernate?