Skip to content

Commit a7acbed

Browse files
committed
NH-3763 - Register bit operations for Oracle
1 parent d9ee469 commit a7acbed

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/NHibernate/Dialect/Oracle8iDialect.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ protected virtual void RegisterFunctions()
224224
RegisterFunction("str", new StandardSQLFunction("to_char", NHibernateUtil.String));
225225

226226
RegisterFunction("iif", new SQLFunctionTemplate(null, "case when ?1 then ?2 else ?3 end"));
227+
228+
RegisterFunction("band", new BitwiseFunctionOperation("bitand"));
229+
RegisterFunction("bor", new SQLFunctionTemplate(null, "?1 + ?2 - BITAND(?1, ?2)"));
230+
RegisterFunction("bxor", new SQLFunctionTemplate(null, "?1 + ?2 - BITAND(?1, ?2) * 2"));
231+
RegisterFunction("bnot", new SQLFunctionTemplate(null, "(-1 - ?1)"));
227232
}
228233

229234
protected internal virtual void RegisterDefaultProperties()
@@ -302,7 +307,7 @@ public override SqlString GetLimitString(SqlString sql, SqlString offset, SqlStr
302307
return pagingSelect.ToSqlString();
303308
}
304309

305-
private string ExtractColumnOrAliasNames(SqlString select)
310+
private static string ExtractColumnOrAliasNames(SqlString select)
306311
{
307312
List<SqlString> columnsOrAliases;
308313
Dictionary<SqlString, SqlString> aliasToColumn;

0 commit comments

Comments
 (0)