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