File tree Expand file tree Collapse file tree 3 files changed +7
-34
lines changed Expand file tree Collapse file tree 3 files changed +7
-34
lines changed Original file line number Diff line number Diff line change @@ -222,16 +222,6 @@ public int ExecuteNonQuery(IDbCommand cmd)
222222 }
223223 }
224224
225- public void RemoveUnusedCommandParameters ( IDbCommand cmd , SqlString sqlString )
226- {
227- Driver . RemoveUnusedCommandParameters ( cmd , sqlString ) ;
228- }
229-
230- public void ExpandQueryParameters ( IDbCommand cmd , SqlString sqlString )
231- {
232- Driver . ExpandQueryParameters ( cmd , sqlString ) ;
233- }
234-
235225 public IDataReader ExecuteReader ( IDbCommand cmd )
236226 {
237227 CheckReaders ( ) ;
Original file line number Diff line number Diff line change @@ -131,25 +131,6 @@ public interface IBatcher : IDisposable
131131 /// </remarks>
132132 int ExecuteNonQuery ( IDbCommand cmd ) ;
133133
134- /// <summary>
135- /// Remove 'extra' parameters from the IDbCommand
136- /// </summary>
137- /// <remarks>
138- /// We sometimes create more parameters than necessary (see NH-2792 & also comments in SqlStringFormatter.ISqlStringVisitor.Parameter)
139- /// </remarks>
140- void RemoveUnusedCommandParameters ( IDbCommand cmd , SqlString sqlString ) ;
141-
142- /// <summary>
143- /// Expand the parameters of the cmd to have a single parameter for each parameter in the
144- /// sql string
145- /// </summary>
146- /// <remarks>
147- /// This is for databases that do not support named parameters. So, instead of a single parameter
148- /// for 'select ... from MyTable t where t.Col1 = @p0 and t.Col2 = @p0' we can issue
149- /// 'select ... from MyTable t where t.Col1 = ? and t.Col2 = ?'
150- /// </remarks>
151- void ExpandQueryParameters ( IDbCommand cmd , SqlString sqlString ) ;
152-
153134 /// <summary>
154135 /// Must be called when an exception occurs.
155136 /// </summary>
Original file line number Diff line number Diff line change 1010
1111using NHibernate . AdoNet ;
1212using NHibernate . Cache ;
13- using NHibernate . Collection ;
13+ using NHibernate . Collection ;
14+ using NHibernate . Driver ;
1415using NHibernate . Engine ;
1516using NHibernate . Event ;
1617using NHibernate . Exceptions ;
@@ -1146,10 +1147,11 @@ protected internal virtual IDbCommand PrepareQueryCommand(QueryParameters queryP
11461147 command . CommandTimeout = selection . Timeout ;
11471148 }
11481149
1149- sqlCommand . Bind ( command , session ) ;
1150-
1151- session . Batcher . RemoveUnusedCommandParameters ( command , sqlString ) ;
1152- session . Batcher . ExpandQueryParameters ( command , sqlString ) ;
1150+ sqlCommand . Bind ( command , session ) ;
1151+
1152+ IDriver driver = factory . ConnectionProvider . Driver ;
1153+ driver . RemoveUnusedCommandParameters ( command , sqlString ) ;
1154+ driver . ExpandQueryParameters ( command , sqlString ) ;
11531155 }
11541156 catch ( HibernateException )
11551157 {
You can’t perform that action at this time.
0 commit comments