From: <fab...@us...> - 2009-01-10 15:10:40
|
Revision: 3986 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3986&view=rev Author: fabiomaulo Date: 2009-01-10 15:10:34 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Fix NH-1491 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Dialect/FirebirdDialect.cs trunk/nhibernate/src/NHibernate/Dialect/Function/NoArgSQLFunction.cs trunk/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs Modified: trunk/nhibernate/src/NHibernate/Dialect/FirebirdDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/FirebirdDialect.cs 2009-01-10 12:47:32 UTC (rev 3985) +++ trunk/nhibernate/src/NHibernate/Dialect/FirebirdDialect.cs 2009-01-10 15:10:34 UTC (rev 3986) @@ -225,9 +225,9 @@ { return new SqlStringBuilder() .Add("cast('") - .Add(name) + .Add(Name) .Add("' as ") - .Add(returnType.SqlTypes(factory)[0].ToString()) + .Add(FunctionReturnType.SqlTypes(factory)[0].ToString()) .Add(")") .ToSqlString(); } @@ -241,7 +241,7 @@ public override SqlString Render(IList args, ISessionFactoryImplementor factory) { - return new SqlString(name); + return new SqlString(Name); } } Modified: trunk/nhibernate/src/NHibernate/Dialect/Function/NoArgSQLFunction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/Function/NoArgSQLFunction.cs 2009-01-10 12:47:32 UTC (rev 3985) +++ trunk/nhibernate/src/NHibernate/Dialect/Function/NoArgSQLFunction.cs 2009-01-10 15:10:34 UTC (rev 3986) @@ -10,36 +10,27 @@ /// </summary> public class NoArgSQLFunction : ISQLFunction { - protected readonly IType returnType = null; - protected readonly string name; - private readonly bool hasParenthesesIfNoArguments; - - public NoArgSQLFunction(string name, IType returnType) : this(name, returnType, true) + public NoArgSQLFunction(string name, IType returnType) + : this(name, returnType, true) { } public NoArgSQLFunction(string name, IType returnType, bool hasParenthesesIfNoArguments) { - this.name = name; - this.returnType = returnType; - this.hasParenthesesIfNoArguments = hasParenthesesIfNoArguments; + Name = name; + FunctionReturnType = returnType; + HasParenthesesIfNoArguments = hasParenthesesIfNoArguments; } - protected IType FunctionReturnType - { - get { return returnType; } - } + public IType FunctionReturnType { get; protected set; } - protected string Name - { - get { return name; } - } + public string Name { get; protected set; } #region ISQLFunction Members public IType ReturnType(IType columnType, IMapping mapping) { - return returnType; + return FunctionReturnType; } public bool HasArguments @@ -47,24 +38,21 @@ get { return false; } } - public bool HasParenthesesIfNoArguments - { - get { return hasParenthesesIfNoArguments; } - } + public bool HasParenthesesIfNoArguments { get; protected set; } public virtual SqlString Render(IList args, ISessionFactoryImplementor factory) { if (args.Count > 0) { - throw new QueryException("function takes no arguments: " + name); + throw new QueryException("function takes no arguments: " + Name); } - if (hasParenthesesIfNoArguments) + if (HasParenthesesIfNoArguments) { - return new SqlString(name + "()"); + return new SqlString(Name + "()"); } - return new SqlString(name); + return new SqlString(Name); } #endregion Modified: trunk/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs 2009-01-10 12:47:32 UTC (rev 3985) +++ trunk/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs 2009-01-10 15:10:34 UTC (rev 3986) @@ -260,7 +260,7 @@ public override SqlString Render(IList args, ISessionFactoryImplementor factory) { - return new SqlString(name); + return new SqlString(Name); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |