Skip to content

Commit a8312a5

Browse files
committed
Override current_timestamp in Firebird4
1 parent b34511d commit a8312a5

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
using NHibernate.Dialect.Function;
2+
13
namespace NHibernate.Dialect
24
{
35
public class Firebird4Dialect: FirebirdDialect
46
{
7+
protected override void RegisterFunctions()
8+
{
9+
base.RegisterFunctions();
10+
RegisterFunction("current_timestamp", new NoArgSQLFunction("localtimestamp", NHibernateUtil.LocalDateTime, false));
11+
}
512
}
613
}

src/NHibernate/Dialect/FirebirdDialect.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -152,19 +152,6 @@ public override SqlString Render(IList args, ISessionFactoryImplementor factory)
152152
}
153153
}
154154

155-
[Serializable]
156-
private class CurrentTimeStamp : NoArgSQLFunction
157-
{
158-
public CurrentTimeStamp() : base("current_timestamp", NHibernateUtil.LocalDateTime, true)
159-
{
160-
}
161-
162-
public override SqlString Render(IList args, ISessionFactoryImplementor factory)
163-
{
164-
return new SqlString(Name);
165-
}
166-
}
167-
168155
public override IDataBaseSchema GetDataBaseSchema(DbConnection connection)
169156
{
170157
return new FirebirdDataBaseSchema(connection);
@@ -474,7 +461,7 @@ protected virtual void RegisterFunctions()
474461

475462
private void OverrideStandardHQLFunctions()
476463
{
477-
RegisterFunction("current_timestamp", new CurrentTimeStamp());
464+
RegisterFunction("current_timestamp", new NoArgSQLFunction("current_timestamp", NHibernateUtil.LocalDateTime, false));
478465
RegisterFunction("current_date", new NoArgSQLFunction("current_date", NHibernateUtil.LocalDate, false));
479466
RegisterFunction("length", new StandardSafeSQLFunction("char_length", NHibernateUtil.Int64, 1));
480467
RegisterFunction("nullif", new StandardSafeSQLFunction("nullif", 2));

0 commit comments

Comments
 (0)