Using concat inside a case clause leads to QuerySyntaxException: unexpected token: ||
It compiles in HQL like:
It looks like 'A' || 'B' expression should be wrapped with brackets, while using HQL directly with wrapped value(i.e. ('A' || 'B')) works properly.
Test case added
Fixed in 5.1 and 5.0 branches as well.as master.