-->
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: Array parameters in ISession.Find
PostPosted: Fri Aug 05, 2005 7:32 am 
hi!

I'm quite new to NH, what I've seen till now is great!

I ask for help because I don't understand how to use the ISession.Find(string query, object value, IType type) function with an array parameter.

the query is:
from Appointment as appointment where appointment.Day in (?)

the value is an array of DateTime.

what is the correct type to use? the ObjectType doesn't work, while the ArrayType constructor asks me for a role parameter that I ignore.

thank you
lorenzo


Top
  
 
 Post subject:
PostPosted: Sat Aug 06, 2005 6:21 am 
Regular
Regular

Joined: Mon Jul 18, 2005 4:10 am
Posts: 92
Location: Poland
I'm not sure about ISession.Find but I suggest using a query:
Code:
String sql = "from Cat cat where cat.id in (:keys)";
IQuery q = mySession().createQuery(sql);

And then use
Code:
q.setParameterList("keys",...)
to bind a collection (array) parameter.

_________________
michal


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.