tag:blogger.com,1999:blog-9150561117329868491.post5091320955068584948..comments2023-10-08T20:48:43.878+05:30Comments on My Journey Through IT: SQL with Hibernate CriteriaDinuka Arseculeratnehttp://www.blogger.com/profile/13924080326710656628noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-9150561117329868491.post-15193069581285802812011-09-01T16:50:04.606+05:302011-09-01T16:50:04.606+05:30Hi Dhanuka,
Yes you are correct that truncating d...Hi Dhanuka,<br /><br />Yes you are correct that truncating does have performance impacts. The post was intended to disseminate the ability to use pure SQL within the criteria API when the need arise. But i agree with your point 100%. We can achieve this with a BETWEEN syntax as well i believe or you can use as <br /><br />to_char(emp_date, 'DD-MM-YYYY') and do a string comparison. But Dinuka Arseculeratnehttps://www.blogger.com/profile/13924080326710656628noreply@blogger.comtag:blogger.com,1999:blog-9150561117329868491.post-3317202077150899432011-09-01T13:48:56.823+05:302011-09-01T13:48:56.823+05:30Hi Dinuka,
Small suggestion, It's better not ...Hi Dinuka,<br /><br />Small suggestion, It's better not to use trunc() with table columns since it has an impact in performance. Even we use functional indexing there is an impact.<br /><br />reference :<br />http://hoopercharles.wordpress.com/2010/03/08/impact-of-the-trunc-function-on-an-indexed-date-column/<br /><br />Better way:<br /><br />emp_join_date >= to_date('01/09/2011',&dhanuka ranasinghehttps://www.blogger.com/profile/05005320328581048321noreply@blogger.comtag:blogger.com,1999:blog-9150561117329868491.post-88222188443834607382010-12-01T09:07:05.720+05:302010-12-01T09:07:05.720+05:30Hi Mark,
Thx for your comment. But to achieve dyn...Hi Mark,<br /><br />Thx for your comment. But to achieve dynamic queries with pure HQL is hard isnt it? So in that instance only do i recommend this.<br /><br />CheersDinuka Arseculeratnehttps://www.blogger.com/profile/13924080326710656628noreply@blogger.comtag:blogger.com,1999:blog-9150561117329868491.post-36378537681249341912010-12-01T07:26:56.670+05:302010-12-01T07:26:56.670+05:30use HQLuse HQLMark Nuttallhttps://www.blogger.com/profile/11521440812448315535noreply@blogger.comtag:blogger.com,1999:blog-9150561117329868491.post-61954931129726715422010-11-28T11:30:48.895+05:302010-11-28T11:30:48.895+05:30Cool Tip ! Thanks for sharing.Cool Tip ! Thanks for sharing.Yohan Liyanagehttps://www.blogger.com/profile/04974425422085607219noreply@blogger.com