Skip to content

Commit 4e167e8

Browse files
committed
NH-3193 - Port-back string functions to MsSqlCeDialect
1 parent 7624979 commit 4e167e8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/NHibernate/Dialect/MsSqlCeDialect.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ public MsSqlCeDialect()
5353
RegisterFunction("month", new SQLFunctionTemplate(NHibernateUtil.Int32, "datepart(month, ?1)"));
5454
RegisterFunction("year", new SQLFunctionTemplate(NHibernateUtil.Int32, "datepart(year, ?1)"));
5555

56+
RegisterFunction("length", new StandardSQLFunction("len", NHibernateUtil.Int32));
57+
RegisterFunction("locate", new StandardSQLFunction("charindex", NHibernateUtil.Int32));
58+
RegisterFunction("replace", new StandardSafeSQLFunction("replace", NHibernateUtil.String, 3));
59+
RegisterFunction("rtrim", new StandardSQLFunction("rtrim"));
60+
RegisterFunction("ltrim", new StandardSQLFunction("ltrim"));
61+
RegisterFunction("upper", new StandardSQLFunction("upper"));
62+
RegisterFunction("lower", new StandardSQLFunction("lower"));
63+
64+
RegisterFunction("trim", new AnsiTrimEmulationFunction());
65+
5666
DefaultProperties[Environment.ConnectionDriver] = "NHibernate.Driver.SqlServerCeDriver";
5767
DefaultProperties[Environment.PrepareSql] = "false";
5868
}

0 commit comments

Comments
 (0)