Hello,
Migrating from 5.6.4 to 6.2.6 I encountered a wrong java type constructor instantiation:
Caused by: org.hibernate.query.sqm.sql.internal.InstantiationException: Error performing dynamic instantiation : mypackage.OptionDto
OptionDto has the following constructors:
public OptionDto(long value, String title) {
…
}
public OptionDto(int value, String title) {
…
}
Extracted argument types are Long and String, but hibernate uses the constructor with type int and String.
While debuging, I noticed it evaluates that int and long are assignment compatible (see org.hibernate.query.sqm.tree.expression.Compatibility.isIntegralTypePrimitive(Class potentialIntegral)) so it selects the wrong constructor that later fails using java reflection instantiation