-->
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: Calendar in Where clause
PostPosted: Tue Dec 26, 2006 3:20 pm 
Newbie

Joined: Wed Oct 04, 2006 2:43 pm
Posts: 16
Location: Lexington, KY
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3.0

I'm trying to build an HQL query into my DB and want to pass in a Calendar as the parameter to query everything for that date. How do I do that?

When I create the query string I have to convert the calendar to a string somehow. How do I do this?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 01, 2007 10:45 am 
Newbie

Joined: Mon Dec 25, 2006 3:14 pm
Posts: 18
> want to pass in a Calendar as the parameter to query everything for that date. How do I do that?
Use setCalendarMethod on the query, javadoc: http://www.hibernate.org/hib_docs/v3/ap ... lendar(int,
java.util.Calendar)

> When I create the query string I have to convert the calendar to a string somehow. How do I do this?
use SimpleDateFormat, http://java.sun.com/j2se/1.5.0/docs/api ... ormat.html


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.