Skip to content

Commit aed3084

Browse files
fredericDelaportehazzik
authored andcommitted
Supply expected values to GetIdentitySelectString
The entity persister was supplying the table name as the column parameter and the column name as the table parameter. This has no effect on NHibernate tests because GetIdentitySelectString does not use its parameters by default and no built-in dialects overrides it for using them. Fixes nhibernate#1635
1 parent cf7247a commit aed3084

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

src/NHibernate/Dialect/Dialect.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -990,14 +990,14 @@ public virtual SqlString AppendIdentitySelectToInsert(SqlString insertString)
990990
return insertString;
991991
}
992992

993-
/// <summary>
993+
/// <summary>
994994
/// Get the select command to use to retrieve the last generated IDENTITY
995-
/// value for a particular table
995+
/// value for a particular table.
996996
/// </summary>
997-
/// <param name="tableName">The table into which the insert was done </param>
998-
/// <param name="identityColumn">The PK column. </param>
999-
/// <param name="type">The <see cref="DbType"/> type code. </param>
1000-
/// <returns> The appropriate select command </returns>
997+
/// <param name="identityColumn">The PK column.</param>
998+
/// <param name="tableName">The table into which the insert was done.</param>
999+
/// <param name="type">The <see cref="DbType"/> type code.</param>
1000+
/// <returns>The appropriate select command.</returns>
10011001
public virtual string GetIdentitySelectString(string identityColumn, string tableName, DbType type)
10021002
{
10031003
return IdentitySelectString;

src/NHibernate/Dialect/InformixDialect.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -275,14 +275,7 @@ public override bool HasDataTypeInIdentityColumn
275275
get { return false; }
276276
}
277277

278-
/// <summary>
279-
/// Get the select command to use to retrieve the last generated IDENTITY
280-
/// value for a particular table
281-
/// </summary>
282-
/// <param name="tableName">The table into which the insert was done </param>
283-
/// <param name="identityColumn">The PK column. </param>
284-
/// <param name="type">The <see cref="DbType"/> type code. </param>
285-
/// <returns> The appropriate select command </returns>
278+
/// <inheritdoc />
286279
public override string GetIdentitySelectString(string identityColumn, string tableName, DbType type)
287280
{
288281
return type == DbType.Int64

src/NHibernate/Persister/Entity/AbstractEntityPersister.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,8 +755,8 @@ public string IdentitySelectString
755755
{
756756
if (identitySelectString == null)
757757
identitySelectString =
758-
Factory.Dialect.GetIdentitySelectString(GetTableName(0), GetKeyColumns(0)[0],
759-
IdentifierType.SqlTypes(Factory)[0].DbType);
758+
Factory.Dialect.GetIdentitySelectString(GetKeyColumns(0)[0], GetTableName(0),
759+
IdentifierType.SqlTypes(Factory)[0].DbType);
760760
return identitySelectString;
761761
}
762762
}

0 commit comments

Comments
 (0)