|
From: <fab...@us...> - 2008-10-11 23:38:21
|
Revision: 3853
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3853&view=rev
Author: fabiomaulo
Date: 2008-10-11 23:38:11 +0000 (Sat, 11 Oct 2008)
Log Message:
-----------
Retouch Fix of NH-1047 in order to use generics.
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 23:15:18 UTC (rev 3852)
+++ trunk/nhibernate/src/NHibernate/IQuery.cs 2008-10-11 23:38:11 UTC (rev 3853)
@@ -189,25 +189,22 @@
/// <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);
+ /// <typeparam name="T">The parameter's <see cref="Type"/> </typeparam>
+ IQuery SetParameter<T>(int position, T val);
/// <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);
+ /// <typeparam name="T">The parameter's <see cref="Type"/> </typeparam>
+ IQuery SetParameter<T>(string name, T val);
-
-
/// <summary>
/// Bind a value to an indexed parameter, guessing the Hibernate type from
/// the class of the given object.
Modified: trunk/nhibernate/src/NHibernate/Impl/AbstractQueryImpl.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Impl/AbstractQueryImpl.cs 2008-10-11 23:15:18 UTC (rev 3852)
+++ trunk/nhibernate/src/NHibernate/Impl/AbstractQueryImpl.cs 2008-10-11 23:38:11 UTC (rev 3853)
@@ -322,17 +322,16 @@
}
}
- public IQuery SetParameter(int position, object val, System.Type type)
+ public IQuery SetParameter<T>(int position, T val)
{
- return SetParameter(position, val, GuessType(type));
+ return SetParameter(position, val, GuessType(typeof (T)));
}
- public IQuery SetParameter(string name,object val,System.Type type)
+ public IQuery SetParameter<T>(string name, T val)
{
- return SetParameter(name, val, GuessType(type));
+ return SetParameter(name, val, GuessType(typeof (T)));
}
-
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.
|