Generate SQL to get the identifier of an inserted row. If the returned value is not null, the caller will prepare a statement from it, set SQL parameters just as it would for insertSQL, and execute it as a query which is expected to return the identifier of the inserted row. If the returned value is null, the caller will execute insertSQL as an update and then execute IdentitySelectString as a query. The default implementation (in this class) returns nullNothingnullptra null reference (Nothing in Visual Basic).

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

Syntax

Visual Basic (Declaration)
Public Overridable Function AddIdentitySelectToInsert ( _
	insertSql As SqlString, _
	identityColumn As String, _
	tableName As String _
) As SqlString
C#
public virtual SqlString AddIdentitySelectToInsert(
	SqlString insertSql,
	string identityColumn,
	string tableName
)
Visual C++
public:
virtual SqlString^ AddIdentitySelectToInsert(
	SqlString^ insertSql, 
	String^ identityColumn, 
	String^ tableName
)
JavaScript
function addIdentitySelectToInsert(insertSql, identityColumn, tableName);

Parameters

insertSql
Type: NHibernate.SqlCommand..::.SqlString
a parameterized SQL statement to insert a row into a table.
identityColumn
Type: System..::.String
The column for which the identity generator was specified.
tableName
Type: System..::.String
The name of the table the row is being inserted in.

Return Value

a SQL statement that has the same effect as insertSQL and also gets the identifier of the inserted row. Return nullNothingnullptra null reference (Nothing in Visual Basic) if this dialect doesn't support this feature.

See Also