Skip to content

Commit 83715ee

Browse files
committed
Encapsulate implementation details
1 parent 5f5ad60 commit 83715ee

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/NHibernate/Hql/Ast/ANTLR/SqlGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ private void EndFunctionTemplate(IASTNode m)
313313
private void OutAggregateFunctionName(IASTNode m)
314314
{
315315
var aggregateNode = (AggregateNode) m;
316-
Out(aggregateNode.SqlFunction?.FunctionName ?? aggregateNode.Text);
316+
Out(aggregateNode.SqlFunctionName());
317317
}
318318

319319
private void CommaBetweenParameters(String comma)

src/NHibernate/Hql/Ast/ANTLR/Tree/AggregateNode.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,20 @@ public override IType DataType
3434
base.DataType = value;
3535
}
3636
}
37+
3738
public override void SetScalarColumnText(int i)
3839
{
3940
ColumnHelper.GenerateSingleScalarColumn(ASTFactory, this, i);
4041
}
42+
43+
public string SqlFunctionName()
44+
{
45+
if (SessionFactoryHelper.FindSQLFunction(Text) is ISQLFunctionExtended sqlFunction)
46+
{
47+
return sqlFunction.FunctionName;
48+
}
49+
50+
return Text;
51+
}
4152
}
4253
}

0 commit comments

Comments
 (0)