Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22976/nhibernate/src/NHibernate/Hql
Modified Files:
QueryTranslator.cs
Log Message:
Fixed problem with using SetParameter and with having a named parameter
referenced twice in a query.
Index: QueryTranslator.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql/QueryTranslator.cs,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** QueryTranslator.cs 4 Aug 2004 17:22:44 -0000 1.35
--- QueryTranslator.cs 13 Aug 2004 18:55:33 -0000 1.36
***************
*** 474,478 ****
list.Add(o);
list.Add(loc);
! namedParameters.Add(name, list);
}
else
--- 474,478 ----
list.Add(o);
list.Add(loc);
! namedParameters[name] = list;
}
else
***************
*** 1286,1290 ****
object[] paramValues = null;
! if(namedParams==null)
{
paramTypes = types;
--- 1286,1290 ----
object[] paramValues = null;
! if(namedParams==null || namedParams.Count==0)
{
paramTypes = types;
***************
*** 1300,1305 ****
foreach (DictionaryEntry e in namedParams)
{
- int lastInsertedIndex = paramTypeList.Count;
-
string name = (string) e.Key;
TypedValue typedval = (TypedValue) e.Value;
--- 1300,1303 ----
***************
*** 1308,1311 ****
--- 1306,1311 ----
for (int i = 0; i < locs.Length; i++)
{
+ int lastInsertedIndex = paramTypeList.Count;
+
int insertAt = locs[i];
***************
*** 1314,1318 ****
// of Range exception will be thrown if we add an element at an index
// that is greater than the Count.
! if(insertAt >= lastInsertedIndex)
{
for(int j = lastInsertedIndex; j <= insertAt; j++)
--- 1314,1318 ----
// of Range exception will be thrown if we add an element at an index
// that is greater than the Count.
! if(insertAt >= lastInsertedIndex)
{
for(int j = lastInsertedIndex; j <= insertAt; j++)
|