|
From: <te...@us...> - 2008-10-11 21:22:31
|
Revision: 3848
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3848&view=rev
Author: tehlike
Date: 2008-10-11 21:22:21 +0000 (Sat, 11 Oct 2008)
Log Message:
-----------
Adding overload for SetParameter using System.Type(No Test)(fix 1047)
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/IQuery.cs
trunk/nhibernate/src/NHibernate/Impl/AbstractQueryImpl.cs
Modified: trunk/nhibernate/src/NHibernate/IQuery.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/IQuery.cs 2008-10-11 20:25:14 UTC (rev 3847)
+++ trunk/nhibernate/src/NHibernate/IQuery.cs 2008-10-11 21:22:21 UTC (rev 3848)
@@ -189,7 +189,26 @@
/// <param name="type">The NHibernate <see cref="IType"/>.</param>
IQuery SetParameter(string name, object val, IType type);
+
/// <summary>
+ /// Bind a value to an indexed parameter.
+ /// </summary>
+ /// <param name="position">Position of the parameter in the query, numbered from <c>0</c></param>
+ /// <param name="val">The possibly null parameter value</param>
+ /// <param name="type">The System.Type</param>
+ IQuery SetParameter(int position, object val, System.Type type);
+
+ /// <summary>
+ /// Bind a value to a named query parameter
+ /// </summary>
+ /// <param name="name">The name of the parameter</param>
+ /// <param name="val">The possibly null parameter value</param>
+ /// <param name="type">The System.Type.</param>
+ IQuery SetParameter(string name, object val, System.Type type);
+
+
+
+ /// <summary>
/// Bind a value to an indexed parameter, guessing the Hibernate type from
/// the class of the given object.
/// </summary>
Modified: trunk/nhibernate/src/NHibernate/Impl/AbstractQueryImpl.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Impl/AbstractQueryImpl.cs 2008-10-11 20:25:14 UTC (rev 3847)
+++ trunk/nhibernate/src/NHibernate/Impl/AbstractQueryImpl.cs 2008-10-11 21:22:21 UTC (rev 3848)
@@ -322,6 +322,17 @@
}
}
+ public IQuery SetParameter(int position, object val, System.Type type)
+ {
+ return SetParameter(position, val, GuessType(type));
+ }
+
+ public IQuery SetParameter(string name,object val,System.Type type)
+ {
+ return SetParameter(name, val, GuessType(type));
+ }
+
+
public IQuery SetParameter(string name, object val)
{
if (!parameterMetadata.NamedParameterNames.Contains(name))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|