@@ -501,15 +501,15 @@ public virtual ILockingStrategy GetLockingStrategy(ILockable lockable, LockMode
501
501
/// <returns> The appropriate for update fragment. </returns>
502
502
public virtual string GetForUpdateString ( LockMode lockMode )
503
503
{
504
- if ( lockMode == LockMode . Upgrade )
504
+ if ( Equals ( lockMode , LockMode . Upgrade ) )
505
505
{
506
506
return ForUpdateString ;
507
507
}
508
- if ( lockMode == LockMode . UpgradeNoWait )
508
+ if ( Equals ( lockMode , LockMode . UpgradeNoWait ) )
509
509
{
510
510
return ForUpdateNowaitString ;
511
511
}
512
- if ( lockMode == LockMode . Force )
512
+ if ( Equals ( lockMode , LockMode . Force ) )
513
513
{
514
514
return ForUpdateNowaitString ;
515
515
}
@@ -526,14 +526,30 @@ public virtual string ForUpdateString
526
526
get { return " for update" ; }
527
527
}
528
528
529
- /// <summary> Is <tt>FOR UPDATE OF</tt> syntax supported? </summary>
530
- /// <value> True if the database supports <tt>FOR UPDATE OF</tt> syntax; false otherwise. </value>
529
+ /// <summary>Is <c>FOR UPDATE OF</c> syntax supported?</summary>
530
+ /// <value><see langword="true"/> if the database supports <c>FOR UPDATE OF</c> syntax; <see langword="false"/> otherwise. </value>
531
+ public virtual bool SupportsForUpdateOf
532
+ // By default, just check UsesColumnsWithForUpdateOf. ForUpdateOf needs to be overriden only for dialects supporting
533
+ // "For Update Of" on table aliases.
534
+ => UsesColumnsWithForUpdateOf ;
535
+
536
+ /// <summary>Is <c>FOR UPDATE OF</c> syntax expecting columns?</summary>
537
+ /// <value><see langword="true"/> if the database expects a column list with <c>FOR UPDATE OF</c> syntax,
538
+ /// <see langword="false"/> if it expects table alias instead or do not support <c>FOR UPDATE OF</c> syntax.</value>
539
+ // Since v5.1
540
+ [ Obsolete ( "Use UsesColumnsWithForUpdateOf instead" ) ]
531
541
public virtual bool ForUpdateOfColumns
532
542
{
533
543
// by default we report no support
534
544
get { return false ; }
535
545
}
536
546
547
+ public virtual bool UsesColumnsWithForUpdateOf
548
+ #pragma warning disable 618
549
+ // For avoiding a breaking change, we need to call the old name by default.
550
+ => ForUpdateOfColumns ;
551
+ #pragma warning restore 618
552
+
537
553
/// <summary>
538
554
/// Does this dialect support <tt>FOR UPDATE</tt> in conjunction with outer joined rows?
539
555
/// </summary>
@@ -567,11 +583,11 @@ public virtual string ForUpdateNowaitString
567
583
}
568
584
569
585
/// <summary>
570
- /// Get the <tt >FOR UPDATE OF column_list NOWAIT</tt > fragment appropriate
571
- /// for this dialect given the aliases of the columns to be write locked.
586
+ /// Get the <c >FOR UPDATE OF column_list NOWAIT</c > fragment appropriate
587
+ /// for this dialect given the aliases of the columns or tables to be write locked.
572
588
/// </summary>
573
- /// <param name="aliases">The columns to be write locked. </param>
574
- /// <returns> The appropriate <tt >FOR UPDATE colunm_list NOWAIT</tt > clause string. </returns>
589
+ /// <param name="aliases">The columns or tables to be write locked.</param>
590
+ /// <returns>The appropriate <c >FOR UPDATE colunm_or_table_list NOWAIT</c > clause string.</returns>
575
591
public virtual string GetForUpdateNowaitString ( string aliases )
576
592
{
577
593
return GetForUpdateString ( aliases ) ;
0 commit comments