Modifies the given SQL by applying the appropriate updates for the specified lock modes and key columns.

Namespace: NHibernate.Dialect
Assembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)

Syntax

C#
public virtual SqlString ApplyLocksToSql(
	SqlString sql,
	IDictionary<string, LockMode> aliasedLockModes,
	IDictionary<string, string[]> keyColumnNames
)
Visual Basic
Public Overridable Function ApplyLocksToSql ( _
	sql As SqlString, _
	aliasedLockModes As IDictionary(Of String, LockMode), _
	keyColumnNames As IDictionary(Of String, String()) _
) As SqlString
Visual C++
public:
virtual SqlString^ ApplyLocksToSql(
	SqlString^ sql, 
	IDictionary<String^, LockMode^>^ aliasedLockModes, 
	IDictionary<String^, array<String^>^>^ keyColumnNames
)

Parameters

sql
Type: NHibernate.SqlCommand..::..SqlString
the SQL string to modify
aliasedLockModes
Type: System.Collections.Generic..::..IDictionary<(Of <(<'String, LockMode>)>)>
a map of lock modes indexed by aliased table names.
keyColumnNames
Type: System.Collections.Generic..::..IDictionary<(Of <(<'String, array<String>[]()[][]>)>)>
a map of key columns indexed by aliased table names.

Return Value

the modified SQL string.

Remarks

The behavior here is that of an ANSI SQL SELECT FOR UPDATE. This method is really intended to allow dialects which do not support SELECT FOR UPDATE to achieve this in their own fashion.

See Also