11using System ;
22using System . Collections ;
3- using NHibernate . Dialect . Function ;
43using NHibernate . Engine ;
54using NHibernate . SqlCommand ;
65using NHibernate . Type ;
76
7+ // 6.0 TODO: remove NHibernate.Dialect.BitwiseNativeOperation,
8+ // and remove "Function." prefix where the non obsolete one is used.
89namespace NHibernate . Dialect
10+ {
11+ /// <inheritdoc />
12+ [ Serializable ]
13+ // Since 5.2
14+ [ Obsolete ( "Use NHibernate.Dialect.Function.BitwiseNativeOperation instead" ) ]
15+ public class BitwiseNativeOperation : Function . BitwiseNativeOperation
16+ {
17+ /// <inheritdoc />
18+ public BitwiseNativeOperation ( string sqlOpToken ) : base ( sqlOpToken )
19+ {
20+ }
21+
22+ /// <inheritdoc />
23+ public BitwiseNativeOperation ( string sqlOpToken , bool isNot ) : base ( sqlOpToken , isNot )
24+ {
25+ }
26+ }
27+ }
28+
29+ namespace NHibernate . Dialect . Function
930{
1031 /// <summary>
1132 /// Treats bitwise operations as native operations.
@@ -14,7 +35,7 @@ namespace NHibernate.Dialect
1435 public class BitwiseNativeOperation : ISQLFunction
1536 {
1637 private readonly string _sqlOpToken ;
17- private readonly bool _isNot ;
38+ private readonly bool _isUnary ;
1839
1940 /// <summary>
2041 /// Creates an instance using the giving token.
@@ -34,11 +55,11 @@ public BitwiseNativeOperation(string sqlOpToken)
3455 /// Creates an instance using the giving token and the flag indicating if it is an unary operator.
3556 /// </summary>
3657 /// <param name="sqlOpToken">The operation token.</param>
37- /// <param name="isNot ">Whether the operation is unary or not.</param>
38- public BitwiseNativeOperation ( string sqlOpToken , bool isNot )
58+ /// <param name="isUnary ">Whether the operation is unary or not.</param>
59+ public BitwiseNativeOperation ( string sqlOpToken , bool isUnary )
3960 {
4061 _sqlOpToken = sqlOpToken ;
41- _isNot = isNot ;
62+ _isUnary = isUnary ;
4263 }
4364
4465 #region ISQLFunction Members
@@ -63,11 +84,11 @@ public SqlString Render(IList args, ISessionFactoryImplementor factory)
6384
6485 var sqlBuffer = new SqlStringBuilder ( ) ;
6586
66- if ( ! _isNot )
87+ if ( ! _isUnary )
6788 AddToBuffer ( args [ 0 ] , sqlBuffer ) ;
6889
6990 sqlBuffer . Add ( " " ) . Add ( _sqlOpToken ) . Add ( " " ) ;
70- for ( var i = _isNot ? 0 : 1 ; i < args . Count ; i ++ )
91+ for ( var i = _isUnary ? 0 : 1 ; i < args . Count ; i ++ )
7192 {
7293 AddToBuffer ( args [ i ] , sqlBuffer ) ;
7394 }
0 commit comments