Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Case When statement in Criteria?  RSS feed

John Bartlett
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have a query written in Criteria that is in desperate need of a "Case When" statement but I cannot seem to find this functionality. Am I missing something or does Criteria have another way of doing this statement?

My basic problem is that I am pulling back a list of entities and mapping the values needed onto a UI row class for viewing, but two of the attributes on the row class are only set when a specific value is set to an attribute in the entity being pulled back.

Any help would be greatly appreciated.

Thank you,

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!