-->
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: date criteria
PostPosted: Tue Dec 09, 2008 9:36 am 
Newbie

Joined: Tue Dec 09, 2008 9:13 am
Posts: 1
Location: kolkata
I am using oracle database.In a table there is a column field whoose
name is TransactionDate .It's data type is Date. Now i want to write a
particular query which matches the transaction date from the database.


Now the query is :

"from MasterData master where MasterData.dateOfTransaction like '"+new Date(localDate.getTime())+"'");

the criteria is not fulfill.. can anyone give suggestion.....


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 09, 2008 2:52 pm 
Beginner
Beginner

Joined: Thu Oct 02, 2008 10:15 am
Posts: 21
You are doing Java concatenation of Strings here. This would invoke the toString() on the date object . You can turn the hibernate logs on and you will know what am I saying. Also, I would not do a like on a date, rather do a '='.


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.