These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: help with query - case when
PostPosted: Mon Feb 02, 2009 3:15 pm 
Newbie

Joined: Mon Jul 21, 2008 3:01 pm
Posts: 7
I want Nhibernate to generate a query in the following manner..

select case when Priority = 'High' then 0 else 1
end AS BatchPrioritySort, *
from TranslationBatch
order by BatchPrioritySort DESC

The 'High' option will be passed in as a filter criteria so i don't see how I can make it a formula field in the .hbm file.

So essentially I need to order by a varchar / string field and the ordering can change based on how the user filters.

I'm open to writing the SQL but I have many fields which can be filtered by and it is so easy to user Nhibernate objects to build the query!

Thanks -


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.