The syntax used to add a foreign key constraint to a table. If SupportsForeignKeyConstraintInAlterTable is false, the returned string will be added to the create table statement instead. In this case, extra strings, like "add", that apply when using alter table should be omitted.

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

Syntax

C#
public virtual string GetAddForeignKeyConstraintString(
	string constraintName,
	string[] foreignKey,
	string referencedTable,
	string[] primaryKey,
	bool referencesPrimaryKey
)
Visual Basic
Public Overridable Function GetAddForeignKeyConstraintString ( _
	constraintName As String, _
	foreignKey As String(), _
	referencedTable As String, _
	primaryKey As String(), _
	referencesPrimaryKey As Boolean _
) As String
Visual C++
public:
virtual String^ GetAddForeignKeyConstraintString(
	String^ constraintName, 
	array<String^>^ foreignKey, 
	String^ referencedTable, 
	array<String^>^ primaryKey, 
	bool referencesPrimaryKey
)

Parameters

constraintName
Type: System..::..String
The FK constraint name.
foreignKey
Type: array<System..::..String>[]()[][]
The names of the columns comprising the FK
referencedTable
Type: System..::..String
The table referenced by the FK
primaryKey
Type: array<System..::..String>[]()[][]
The explicit columns in the referencedTable referenced by this FK.
referencesPrimaryKey
Type: System..::..Boolean
if false, constraint should be explicit about which column names the constraint refers to

Return Value

the "add FK" fragment

See Also