-->
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.  [ 4 posts ] 
Author Message
 Post subject: COALESCE
PostPosted: Wed Jan 25, 2006 3:39 pm 
Newbie

Joined: Thu Jan 19, 2006 2:36 pm
Posts: 3
Does Hibernate/HQL support COALESCE?
For example:
select userid, COALESCE(ad.lastUpdtTs, dem.lastUpdtTs) as lastUpdtTs from ... order by lastUpdtTs

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 4:59 am 
Regular
Regular

Joined: Wed Jun 29, 2005 11:14 pm
Posts: 119
Location: København
Yeps - if your DB does. Chapter 14.9 (Expressions) in http://www.hibernate.org/hib_docs/v3/re ... ryhql.html


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 5:00 am 
Regular
Regular

Joined: Wed Jun 29, 2005 11:14 pm
Posts: 119
Location: København
Quote:
Expressions allowed in the where clause include most of the kind of things you could write in SQL


Note - only in where clause though


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 5:30 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
define a function in the dialect and it should also work in the select clause.

_________________
Max
Don't forget to rate


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

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.