-->
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: HQL: YEAR(...) in (:years) -> setting int?[] parameter
PostPosted: Wed Nov 15, 2006 11:33 am 
Beginner
Beginner

Joined: Thu Oct 19, 2006 1:03 pm
Posts: 29
"HQL: YEAR(...) in (:years) -> setting int?[] parameter" - means that I want to do this:
Code:
IQuery query = session.CreateQuery(@"from DatabaseObjects.Entry ent
   where YEAR(ent.EntryDate) in (:years)");
query.SetInt32("years", intYears);
EntryCollection coll = new EntryCollection(query.List());


Where intYears is declared:
Code:
int?[] intYears = new int?[] { 2004, 2005, 2006 };


How to do this?

Also, this forum is REALLY slow - why not ask around for a forum written with for example NHibernate using badass caching (e.g. output cache 1 min) to speed it up?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 4:06 am 
Expert
Expert

Joined: Thu Jan 19, 2006 4:29 pm
Posts: 348
Try to use query.SetParameterList(..)

Gert

_________________
If a reply helps You, rate it!


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.