Skip to content

Rename ISQLFunctionExtended.FunctionName to Name #2359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/NHibernate/Dialect/FirebirdDialect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public CastedFunction(string name, IType returnType) : base(name, returnType, fa

public override SqlString Render(IList args, ISessionFactoryImplementor factory)
{
return new SqlString("cast('", FunctionName, "' as ", FunctionReturnType.SqlTypes(factory)[0].ToString(), ")");
return new SqlString("cast('", Name, "' as ", FunctionReturnType.SqlTypes(factory)[0].ToString(), ")");
}
}

Expand All @@ -161,7 +161,7 @@ public CurrentTimeStamp() : base("current_timestamp", NHibernateUtil.LocalDateTi

public override SqlString Render(IList args, ISessionFactoryImplementor factory)
{
return new SqlString(FunctionName);
return new SqlString(Name);
}
}

Expand Down Expand Up @@ -235,7 +235,7 @@ public IType GetEffectiveReturnType(IEnumerable<IType> argumentTypes, IMapping m
}

/// <inheritdoc />
public string FunctionName => "position";
public string Name => "position";

public bool HasArguments
{
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Dialect/Function/AnsiSubstringFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public IType GetEffectiveReturnType(IEnumerable<IType> argumentTypes, IMapping m
}

/// <inheritdoc />
public string FunctionName => "substring";
public string Name => "substring";

public bool HasArguments
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public IType GetEffectiveReturnType(IEnumerable<IType> argumentTypes, IMapping m
}

/// <inheritdoc />
public string FunctionName => null;
public string Name => null;

public bool HasArguments
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public virtual IType GetEffectiveReturnType(IEnumerable<IType> argumentTypes, IM
}

/// <inheritdoc />
public string FunctionName => _functionName;
public string Name => _functionName;

/// <inheritdoc />
public bool HasArguments => true;
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Dialect/Function/BitwiseNativeOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public virtual IType GetEffectiveReturnType(IEnumerable<IType> argumentTypes, IM
}

/// <inheritdoc />
public string FunctionName => null;
public string Name => null;

/// <inheritdoc />
public bool HasArguments => true;
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Dialect/Function/CastFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public virtual IType GetEffectiveReturnType(IEnumerable<IType> argumentTypes, IM
}

/// <inheritdoc />
public string FunctionName => "cast";
public string Name => "cast";

public bool HasArguments
{
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Dialect/Function/CharIndexFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public virtual IType GetEffectiveReturnType(IEnumerable<IType> argumentTypes, IM
}

/// <inheritdoc />
public string FunctionName => "charindex";
public string Name => "charindex";

public bool HasArguments
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public virtual IType GetEffectiveReturnType(IEnumerable<IType> argumentTypes, IM
}

/// <inheritdoc />
public string FunctionName => name;
public string Name => name;

public bool HasArguments
{
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Dialect/Function/ISQLFunctionExtended.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ internal interface ISQLFunctionExtended : ISQLFunction
/// <summary>
/// The function name or <see langword="null"/> when multiple functions/operators/statements are used.
/// </summary>
string FunctionName { get; }
string Name { get; }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a breaking change as ISQLFunctionExtended is not yet released.


/// <summary>
/// Get the function general return type, ignoring underlying database specifics.
Expand Down
16 changes: 4 additions & 12 deletions src/NHibernate/Dialect/Function/NoArgSQLFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,13 @@ public NoArgSQLFunction(string name, IType returnType)

public NoArgSQLFunction(string name, IType returnType, bool hasParenthesesIfNoArguments)
{
#pragma warning disable 618
Name = name;
#pragma warning restore 618
FunctionReturnType = returnType;
HasParenthesesIfNoArguments = hasParenthesesIfNoArguments;
}

public IType FunctionReturnType { get; protected set; }

// Since v5.3
[Obsolete("Use FunctionName property instead.")]
public string Name { get; protected set; }

#region ISQLFunction Members

// Since v5.3
Expand All @@ -58,9 +52,7 @@ public virtual IType GetEffectiveReturnType(IEnumerable<IType> argumentTypes, IM
}

/// <inheritdoc />
#pragma warning disable 618
public string FunctionName => Name;
#pragma warning restore 618
public string Name { get; protected set; }

public bool HasArguments
{
Expand All @@ -73,15 +65,15 @@ public virtual SqlString Render(IList args, ISessionFactoryImplementor factory)
{
if (args.Count > 0)
{
throw new QueryException("function takes no arguments: " + FunctionName);
throw new QueryException("function takes no arguments: " + Name);
}

if (HasParenthesesIfNoArguments)
{
return new SqlString(FunctionName + "()");
return new SqlString(Name + "()");
}

return new SqlString(FunctionName);
return new SqlString(Name);
}

#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Dialect/Function/NvlFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public virtual IType GetEffectiveReturnType(IEnumerable<IType> argumentTypes, IM
}

/// <inheritdoc />
public string FunctionName => "nvl";
public string Name => "nvl";

public bool HasArguments
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public virtual IType GetEffectiveReturnType(IEnumerable<IType> argumentTypes, IM
}

/// <inheritdoc />
public string FunctionName => "position";
public string Name => "position";

public bool HasArguments
{
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Dialect/Function/SQLFunctionTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public virtual IType GetEffectiveReturnType(IEnumerable<IType> argumentTypes, IM
}

/// <inheritdoc />
public virtual string FunctionName => null;
public virtual string Name => null;

public bool HasArguments
{
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Dialect/Function/StandardSQLFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public virtual IType GetEffectiveReturnType(IEnumerable<IType> argumentTypes, IM
}

/// <inheritdoc />
public string FunctionName => name;
public string Name => name;

public bool HasArguments
{
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Dialect/Function/VarArgsSQLFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public virtual IType GetEffectiveReturnType(IEnumerable<IType> argumentTypes, IM
}

/// <inheritdoc />
public virtual string FunctionName => null;
public virtual string Name => null;

public bool HasArguments
{
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Dialect/HanaDialectBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public IType GetEffectiveReturnType(IEnumerable<IType> argumentTypes, IMapping m
}

/// <inheritdoc />
public virtual string FunctionName => "cast";
public virtual string Name => "cast";

public bool HasArguments => true;

Expand Down
4 changes: 2 additions & 2 deletions src/NHibernate/Dialect/Oracle8iDialect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ public CurrentTimeStamp() : base("current_timestamp", NHibernateUtil.LocalDateTi

public override SqlString Render(IList args, ISessionFactoryImplementor factory)
{
return new SqlString(FunctionName);
return new SqlString(Name);
}
}
[Serializable]
Expand Down Expand Up @@ -619,7 +619,7 @@ public IType GetEffectiveReturnType(IEnumerable<IType> argumentTypes, IMapping m
}

/// <inheritdoc />
public string FunctionName => "instr";
public string Name => "instr";

public bool HasArguments
{
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Dialect/PostgreSQLDialect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ public IType GetEffectiveReturnType(IEnumerable<IType> argumentTypes, IMapping m
}

/// <inheritdoc />
public string FunctionName => _name;
public string Name => _name;

public bool HasArguments => true;

Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Hql/Ast/ANTLR/Tree/AggregateNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public string FunctionName
{
if (SessionFactoryHelper.FindSQLFunction(Text) is ISQLFunctionExtended sqlFunction)
{
return sqlFunction.FunctionName;
return sqlFunction.Name;
}

return Text;
Expand Down