1

I know case can be used as expression in where clause of HQL.

I read through this thread Using a CASE statement in HQL select

In a way my question is duplicate

Is it possible to use them in the select part of HQL with hibernate 4 or 5. I know its not possible with Hibernate 3.

Community
  • 1
  • 1
Acewin
  • 1,657
  • 4
  • 17
  • 36

1 Answers1

2

Yes it is.

There is a dedicated section in the Hibernate 5 Documentation you can take a look as well as in this section for Hibernate 4.3.

According to the changelog.txt it was added back in version 3.0 though not in the form it has evolve to today (SimpleCaseExpression, SearchedCaseExpression)

dimitrisli
  • 20,895
  • 12
  • 59
  • 63
  • thanks for the references. Can you please add info (if you know) since which version of hibernate it is allowed. – Acewin Dec 05 '16 at 19:32