From: NHibernate J. <mik...@us...> - 2006-11-17 15:46:30
|
SQLQueryImpl fails to bind parameter lists ------------------------------------------ Key: NH-815 URL: http://jira.nhibernate.org/browse/NH-815 Project: NHibernate Type: Bug Components: Core Versions: 1.2.0.Beta2 Reporter: Peter Jaffe The SQLQueryImpl class does not bind parameter lists properly. This is very easy to reproduce with a simple SQLQuery that has a single named parameter in the WHERE clause (e.g. "where id in (:idList)") and then use the ISQLQuery.SetParameterList("idList", someCollection). This works with an IQuery but fails with an ISQLQuery. I debugged through the source of the 1.2.0 Beta2 and the fix appears very straightforward. See the code snippet below that indicates where the method argument "parameters" should probably be used instead of the class's NamedParams property. public class SqlQueryImpl : AbstractQueryImpl, ISQLQuery { ... public NativeSQLQuerySpecification GenerateQuerySpecification(IDictionary parameters) { return new NativeSQLQuerySpecification( BindParameterLists(NamedParams), <-- ** Probably should have been "parameters" ** GetQueryReturns(), querySpaces); } ... } I'm using the MS SQL Server ADO.NET provider and running under .NET 2.0. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |