$fk

( documentation for Telosys generator version 4.1.0 )


This object provides all information about a database foreign key
Each foreign key is retrieved from the entity class


Example :
   
   #foreach( $fk in $entity.databaseForeignKeys )
    $fk.name
   #end

Since : 2.0.7

Attributes and methods
.attributes : List of 'Foreign Key Attribute' objects ( List of '$fkAttribute' )

Returns all the attributes composing the Foreign Key

Example :
   #foreach( $fkAttribute in $fk.attributes )
   ...
   #end

Since : 3.4.0

.attributesCount : int

Returns the number of attributes composing the foreign key

.isComposite() : boolean

Returns true if the Foreign Key is composite (has more than 1 attribute)

Example :
   #if ( $fk.isComposite() )

Since : 4.1.0

.isExplicit() : boolean

Returns true if the Foreign Key is explicit (defined with name).
Returns false for an implicit Foreign Key.

Example :
   #if ( $fk.isExplicit() )

Since : 4.1.0

.name : String

Returns the name of the Foreign Key

.originEntity : EntityInContext

Returns the origin entity object

Since : 3.4.0

.originEntityName : String

Returns the origin entity name

Since : 3.4.0

.referencedEntity : EntityInContext

Returns the referenced entity object

Since : 3.4.0

.referencedEntityName : String

Returns the referenced entity name

Since : 3.4.0

.sqlName : String

Returns the name of the Foreign Key.
The name is converted according to SQL conventions

.sqlOriginColumns : List

Returns all the columns names composing the Foreign Key
Each column name is converted according the SQL conventions

Example :
   #foreach( $col in $fk.sqlOriginColumns )
   ...
   #end

.sqlOriginColumnsAsString : String

Returns all the columns names composing the Foreign Key in a single string
The columns names are separated by a comma
Each column name is converted according the SQL conventions

.sqlOriginTableName : String

Returns the name of the table holding the foreign key
converted according to SQL conventions

Since : 3.4.0

.sqlReferencedColumns : List

Returns a list containing the names of the referenced columns.
The names are converted according to SQL conventions

Example :
   #foreach( $col in $fk.sqlReferencedColumns )
   ...
   #end

.sqlReferencedColumnsAsString : String

Returns all the names of the referenced columns separated by a comma.
The names are converted according to SQL conventions

.sqlReferencedTableName : String

Returns the name of the referenced table (the table referenced by the foreign key).
The name is converted according to SQL conventions

Since : 3.4.0