-->
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.  [ 3 posts ] 
Author Message
 Post subject: Database matching --- Need Help
PostPosted: Mon Feb 20, 2006 2:04 am 
Beginner
Beginner

Joined: Wed Jan 25, 2006 10:16 am
Posts: 44
Location: Bangalore
I have a table with date column and has a value say, 2006-02-12 10:12:34. iam using MySQL 5.0

Now I have to take only the 10:12 from the above column and match a set of rows in another table which has a column of type Date.
How Do I do it using hibernate? I use HQL basically for retrieval of data.


My Query is something like this.
"List l =getHibernateTemplate().find(" FROM PatientFlowSheetData p where HOUR(p.flowSheetColumnTime) ='10' and MINUTE(p.flowSheetColumnTime) ='12'")" --- This works. :-)

But this is strictly linked with MySQL. I don't want that. Does hibernate have any functions similar to this.

Please reply if I'm not making you understand. I'll try to rephrase.
:-)

_________________
Please vote if my Postings helps. :-)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 20, 2006 8:01 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Pretty much everything available to you in HQL is listed in section 14.9, "Expressions", of the ref docs. hour() and minute() are provided.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2006 12:01 am 
Beginner
Beginner

Joined: Wed Jan 25, 2006 10:16 am
Posts: 44
Location: Bangalore
Wow!! Yes.. How did I miss that?
Just Overlooked it.
Thanks a lot. :-)

_________________
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.  [ 3 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.