createForeignKey function

Creates a new foreign key.

Syntax
ForeignKeySchema Connection.createForeignKey(
  String table_name,
  String primary_table_name,
  String name
) throws ULjException
Parameters
  • table_name   The name of table to contain a foreign key. This is the table constrained to have a valid reference to the primary table.

  • primary_table_name   The name of table containing referenced columns.

  • name   The name of the foreign key. The specified name must be a valid SQL identifier.

Remarks
Note

UltraLiteJ does not enforce foreign key constraints on tables. Foreign keys are used to determine the correct order in which tables should be synchronized. Foreign keys on the client database should match the relations on the consolidated database that the client synchronizes to.

Returns

The ForeignKey with the name and table involvement defined.