Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

from two columns get one based on the value of another column passed in hibernate

 
Bhadra Menon
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Hi ,

In My hbm file i need to write a query where i am passing the UserType and based on the userType whether the person is staff or manager, i should show two different account status to them.
i have a table where i have a primary key- id , userType , staffStatus , managerStatus.
i am passing id and userType to the namedQuery , based on the userType - if it is staff the i have to return staffStatus or if it is managerType then i have to return managerStatus.


Can anyone help me in writing this query , i could so it using DECODE in normal pl/sql but could not make that workout in hbm file

Thanks in advance
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!