mdTranslator

Architecture

Internal Object


entityForeignKey:

The entityForeignKey object defines a foreign key on the referencing (or child) entity in the form of a SQL ALTER TABLE, ADD CONSTRAINT statement.

    def newEntityForeignKey
        intObj = {
            fkLocalAttributes: [],
            fkReferencedEntity: nil,
            fkReferencedAttributes: []
        }
    end

fkLocalAttributes: array (required) - an array of quoted strings listing the local (referencing or child) attribute code names for this foreign key.

fkReferencedEntity: string (required) - the entityID for the referenced (or parent) entity for this foreign key

fkReferencedAttributes: array (required) - an array of quoted strings listing the referenced (or parent) attribute code names for this foreign key. If the foreign key is a compound key (more than one attribute compose the key) the order of the referenced attributes must align precicely with the order and number of local attributes.