-->
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: Comparison of Dates using O/R mapping
PostPosted: Wed Mar 01, 2006 9:06 am 
Newbie

Joined: Wed Mar 01, 2006 8:53 am
Posts: 1
Hello All,

I am new to Hibernate.

I have created a hibernate mapping xml
which contains an entry as follows:
Code:
<property name="fileProcessDate" type="java.util.Date" update="false" insert="false" column="FILE_PROCESS_DT" />


When I create a SearchCriteria to search on a particular date, I need to make the search only on the date part, and not on the timestamp.

But the above mapping tries to compare the time part as well hence resulting in incorrect results.

I want to implement something like this using O/R mapping.

Code:
WHERE TRUNC(FILE_PROCESS_DT) = TRUNC(date_provided_searchcriteria)



Can somebody please help me out ??

TIA.

~Nikunj.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 01, 2006 10:23 am 
Beginner
Beginner

Joined: Wed Jan 25, 2006 10:16 am
Posts: 44
Location: Bangalore
If you search the hibernate reference document you can find some functions like
HOUR(), MINUTE() etc.,
You can use them to work with.

_________________
Please vote if my Postings helps. :-)


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.