| Guillaume Smet this is all completely different in 6.0 and in theory it should not be an issue there. I say in theory because I literally just started work on support for criteria quite recently. This "deduction" (we call it "type inference") is possible in certain situations based on the context in which an expression occurs. JPA well-defines type-inference in a number of contexts (fwiw, case-statements is not one of them). Hibernate supports type-inference in cases beyond what JPA defines. This should be possible pre-6 as well though. It should be as easy as choosing the "noop" handler for literals when we do not otherwise know how to handle them rather than using a null handler. |