From: <fab...@us...> - 2011-06-14 23:05:42
|
Revision: 5928 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5928&view=rev Author: fabiomaulo Date: 2011-06-14 23:05:35 +0000 (Tue, 14 Jun 2011) Log Message: ----------- Removed dead code + Added comment with no minor TODO Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Driver/SqlStringFormatter.cs Modified: trunk/nhibernate/src/NHibernate/Driver/SqlStringFormatter.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Driver/SqlStringFormatter.cs 2011-06-14 21:58:36 UTC (rev 5927) +++ trunk/nhibernate/src/NHibernate/Driver/SqlStringFormatter.cs 2011-06-14 23:05:35 UTC (rev 5928) @@ -56,20 +56,20 @@ return; } + // NH: even if using SqlType[] the final commad may have X parameters, with this line we will use Y parameters in the IDbCommand + // for example the ParameterCollection may contains two parameters called @p0 and @p1 but the command contains just @p0. + // In this way the same parameter can be used in different places in the query without create a problem to the dear SQL-server (see NH1981) + // TODO: find a way to have exactly the same amount of parameters between the final IDbCommand and its IDataParameterCollection + // A candidateplace is making DriverBase.SetCommandParameters a little bit more intelligent... perhaps SqlString aware (see also DriverBase.SetCommandText, DriverBase.GenerateCommand) string name = formatter.GetParameterName(parameter.ParameterPosition ?? parameterIndex); parameterIndex++; result.Append(name); } - private int GetNumberOfPreceedingParameters() - { - int queryIndex = parameterIndexToQueryIndex[parameterIndex]; - return queryIndexToNumberOfPreceedingParameters[queryIndex]; - } - private void DetermineNumberOfPreceedingParametersForEachQuery(SqlString text) { + // NH: this code smell very bad. It look like specific for ORACLE and probably unused even for ORACLE int currentParameterIndex = 0; int currentQueryParameterCount = 0; int currentQueryIndex = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |