CONN Class
 

Parameter:


Mandatory modifier: CHILD. (Not only is it mandatory, it must also be the first modifier.)

Optional modifiers: PREF, SUF, SEP, NULL.

Algorithm:
Processes the rule specified by CHILD for each child occurrence. If at least one child occurrence gives a result, processes the rules specified by PREF and SUF; if at least two child occurrences give a result, processes the rule specified by SEP; then builds the result string by concatenating the PREF result, then the CHILD result for each child occurrence for which a result exists, inserting between each pair of existing results the SEP result, and finally the SUF result. If the result string is empty, processes the rule specified by NULL, and returns the NULL result.

Note that for the PREF, SUF, SEP and NULL modifiers, the current occurrence is the parent occurrence; for the CHILD modifier, the current occurrence is the child occurrence.

Example 1

pukeyColumns    CONN PrimaryuniquekeyColumns,
                CHILD = name
                SEP = ", "
                PREF = "PRIMARY KEY ("
                SUF = ") CONSTRAINT $name;"
                NULL = "()";

name            ATTR ObjectPhysicalname;
 

Remember that the CHILD modifier is mandatory and must occur before any other modifiers.

The PrimaryuniquekeyColumns repository function returns the columns associated to a primary key or a unique key; the ObjectPhysicalname repository function returns the physical name of any object (here the name of a column). If the primary or unique key is named "empl_prim_key" and is made up of the "dept_no" and "empl_no" columns, the result will be:

PRIMARY KEY (dept_no, empl_no) CONSTRAINT empl_prim_key
 
 

Example 2
pukeyColumns    CONN "org.modelsphere.sms.or.db.DbORPrimaryUnique.fColumns",
                CHILD = name
                SEP = ", "
                PREF = "PRIMARY KEY ("
                SUF = ") CONSTRAINT $name;"
                NULL = "()";

name            ATTR "org.modelsphere.sms.db.DbSMSSemanticalObject.fPhysicalName";

The same example as the previous one, but using API meta-fields and meta-connectors instead of repository functions.