-->
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: Need help in converting NativeSQL to Hibernate
PostPosted: Wed May 28, 2008 7:25 am 
Newbie

Joined: Wed May 28, 2008 7:18 am
Posts: 6
Experts,

I am new to hibernate and got most of the examples worked without any issues. However, we are in the process of converting an application that has too many complicated queries to Hibernate. I am not sure why my boss wants that!

Here is a sample of one of the queries from the application

Code:
select m_type,
count(case when scheduled_ts >= DATE(NOW()) and scheduled_ts < DATE(NOW() + INTERVAL 1 DAY )
and h_id= 'BS' then scheduled_ts else NULL END ) as scheduled,
count(case when completed_ts != '0000-00-00 00:00:00' and scheduled_ts >= DATE(NOW()) and
scheduled_ts < DATE(NOW() + INTERVAL 1 DAY ) and h_id= 'BS'
then completed_ts else NULL END) as completed
from order_status where m_type in ('CD','AB')
group by m_type


I am not too sure if I have to use Criteria queries with Projections. Your help would be much appreciated.

Thanks
Samuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 03, 2008 7:33 am 
Newbie

Joined: Wed May 28, 2008 7:18 am
Posts: 6
Can anyone send me some pointers execute crosstab queries with Hibernate? I have hit a dead end!

Thanks
Samuel


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.