Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Hibernate
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Hibernate section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 30th, 2008, 07:37 AM
Registered User
Join Date: May 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to samuels
Default Crosstab with Hibernate


I am relatively new to hibernate and have gone through some basic tutorials and have been successful so far. But I am stumped when I had to convert an application to Hibernate. This uses a lot of crosstab queries and I have no clue where or how to begin. A sample query is pasted below.

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 ('MR','CT') group by m_type
How do I go about this? Can anyone of you give me some pointers? I google'd but found nothing.

Any help would be appreciated.


Similar Threads
Thread Thread Starter Forum Replies Last Post
hibernate.LazyInitializationException briosam BOOK: Beginning Spring Framework 2 ISBN: 978-0-470-10161-2 1 July 2nd, 2008 05:18 AM
Hibernate help boddu.nageswar Hibernate 1 March 22nd, 2008 09:13 AM
Hibernate examples anupkg2008 Hibernate 2 February 14th, 2008 11:29 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.