Hi,
after upgrading from
2.3.1.to QueryDSL 3.1.1 (in 3.2.0 this also happens) I have type mismatch in query projection. Production code uses OracleTemplates and for a long value it returns BigDecimal in AbstractJPASQLQuery#getResultList, whereas in integration Junit tests that use HsqlDB the same column is mapped to BigInteger which results in error:
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysema.query.types.ConstructorExpression.newInstance(ConstructorExpression.java:162)
I tried using the same template in JUnit tests (OracleTemplates instead of HSQLDBTemplates, but to no avail).
I also created custom HSQLDB template with overriden class2type (the same way as in OracleTemplates), but also to no avail.
Thanks for suggesting how to properly construct JUnits in this case.
BR,