Description
It seems that a few operations in JDBCExpressionFactory often calls getLiteralRawString which destroys the information about any real types in a query and replaces it with a Raw which is always of type java.lang.String.
This breaks the following query, which wrongly returns a string instead of a Long:
final TypedQuery<Long> q = em.createQuery("select SUM(CASE ae.stringVal WHEN 'bare' THEN 1 ELSE 0 END) from AggEntity AS ae", Long.class); final Long sumC = q.getSingleResult();
This only affects us since I fixed UnaryOp to not return the native JDBC vendor type of a given column but uses the val.getType()