This is a follow-up of https://hibernate.atlassian.net/browse/HHH-12822.
Apparently, in certain conditions, DB2 requires casts in when and else clauses of a case.
Note that we already have:
so I suspect something similar is required.
Firebird has similar needs. Although in recent versions of Firebird this has been improved, it doesn’t work in all situations (eg in order by - GroupBySelectCaseTest.selectCaseInOrderByAndSelectExpression() and comparisons against a parameters - SelectCaseLiteralHandlingBindTest.whereCaseExpression())