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: sql-query with named parameter exception - no type?
PostPosted: Sat Aug 19, 2006 1:58 am 
Newbie

Joined: Mon Aug 07, 2006 6:40 pm
Posts: 12
Location: Atlanta, GA
Using the current aplha, I have a named query with the named parameter :task_list in an IN clause.

Nhibernate throws an exception:
NHibernate.QueryException: No type assigned to parameter 'p0': be sure to set types for named parameters.

p0 is :task_list

Nhibernate determines from the first element of the collection passed that it is a string later on; but at the time the parameter is passed using SetParameterList the NHibernate.SqlCommand.Parameter object for the parameter is created without an SqlType, which is the reason this exception is thrown from DriverBase during the call to Session.List. It appears to only use the constructors with a SqlType on an HQL or unnamed query.

I can't use HQL because of my subclass provides an alternate way to populate lists with complex SQL that uses columns not in the NH class mappings.

I am at my wits end with this one, anyone have any insights?


Top
 Profile  
 
 Post subject: SqlQueryImpl.SetInt32 differs from SetParameterList
PostPosted: Sat Aug 19, 2006 1:46 pm 
Newbie

Joined: Mon Aug 07, 2006 6:40 pm
Posts: 12
Location: Atlanta, GA
It appears that when I use the exact same named query but assign a single Int32 value to the named parameter instead of the ICollection list of values, the query works. The Typed Value gets built properly in both, SetXxx functions, but later on a Parameter object must be built with a type for the SetInt32 that is not happenning for the SetParameterList as I explained in previous post.

I would like to get the latest build of the Alpha, but I am having trouble finding it. I only see the 5-28 build.

I may also try and get Nant set up, (another goal with no time for at the moment) and build NH with a possible fix. I am having signature problems when I just build NHibernate.dll (I understand why, just need a quicker way to resolve 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.