I have a problem with a SelectCase generated from the Criteria API. In the generated SQL query, the condition's expression in the "when" is used instead of the result's expression. The result's expression is therefore ignored.