Bookmark Topic Watch Topic
  • New Topic

CASE-WHEN in Hibernate  RSS feed

 
Siva Prasad Reddy Katamreddy
Ranch Hand
Posts: 32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Report post to moderator
HI,

Suppose i have a statement written in JDBC as:

SELECT CASE status WHEN 'ACTIVE' THEN '1' WHEN 'PASSIVE' THEN '2' END STATUS_FLAG FROM EMPLOYEE

How to implement this kind of CASE-WHEN type of conditions in Hibernate?

Thanks,
Siva.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Report post to moderator
The other solution is cleaner, easier, and more extensible.
 
Siva Prasad Reddy Katamreddy
Ranch Hand
Posts: 32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Report post to moderator
The other solution is cleaner, easier, and more extensible.


What is that solution??

Thanks,
Siva
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Report post to moderator
The one we're discussing in your other post about the same thing.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37395
531
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
And this is why we request a question be kept in one thread. Locking this one. Please continue discussion in your other thread.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!