-->
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.  [ 2 posts ] 
Author Message
 Post subject: Imitating the CONVERT() function on SQL Server for grouping
PostPosted: Tue Mar 09, 2010 3:13 am 
Newbie

Joined: Tue Mar 09, 2010 2:58 am
Posts: 2
Hi, I'm a bit stumped on finding an HQL equivalent for an existing SQL query that I'm converting for use in my persistence layer. I'm hoping for some advice.

The query contains something like
Code:
GROUP BY ...., CONVERT(nvarchar, entity.timestamp, 103)


which will actually group the result by entity.timestamp but as a date (dd/mm/yyyy) instead of the timestamp.

What is the best way to achieve this in Hibernate? Can this be done directly via HQL? Or should I do it via mapping by creating a UserType to hold only the date values and drop the time values?

Any help appreciated. Thanks.


Top
 Profile  
 
 Post subject: Re: Imitating the CONVERT() function on SQL Server for grouping
PostPosted: Wed Mar 10, 2010 2:25 am 
Newbie

Joined: Tue Mar 09, 2010 2:58 am
Posts: 2
No ideas at all?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.