-->
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: HQL with convert timezone
PostPosted: Thu Mar 17, 2011 9:49 am 
Newbie

Joined: Thu May 18, 2006 6:36 am
Posts: 11
Location: Bangalore
Hi,

I have the following query in SQL

Code:
Select
count(*) as cnt,
DATE_FORMAT(CONVERT_TZ(wrdTrk.createdOnGMTDate,'+00:00',:zone),'%Y-%m-%d') as dat
from
t_twitter_tracking wrdTrk
where
wrdTrk.word like (:word) and wrdTrk.createdOnGMTDate  between  :stDate and :endDate  group by dat;


I am in the process of migrating all this to Hibernate, I have two questions related to this,

1. How can I write the same query in HQL?
2. Can hibernate cache (ehcache) cache native SQL and how does it work. It would be great if someon can point me to the right direction to understand caching of Native SQL queries

Regards,
Rohit


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.