// [ON DELETE {RESTRICT | CASCADE | SET NULL | NO ACTION}]
// [ON UPDATE {RESTRICT | CASCADE | SET NULL | NO ACTION}]
final String fkTemplateStr = ST_ADD_FOREIGN_KEY_CONSTRAINT_STYLE_ONE;
final StringTemplate fkst = new StringTemplate(fkTemplateStr);
final HashMap<String, String> fkValuesMap = new HashMap<String, String>();
fkValuesMap.put(ST_CHILD_TABLE_KEY, localTableName);
if (constraintName != null)
{
fkValuesMap.put(ST_CONSTRAINT_KEY, "CONSTRAINT");
fkValuesMap.put(ST_CONSTRAINT_NAME_KEY, constraintName);
}
fkValuesMap.put(ST_PARENT_TABLE_KEY, refTableName);
StringTemplate ckIndexSt = null;
HashMap<String, String> ckIndexValuesMap = null;
if (autoFKIndex)
{
// "CREATE $unique$ $storageOption$ INDEX $indexName$ " +
// "ON $tableName$ ( $columnName; separator=\",\"$ )";
ckIndexSt = new StringTemplate(ST_CREATE_INDEX_STYLE_TWO);
ckIndexValuesMap = new HashMap<String, String>();
ckIndexValuesMap.put(ST_INDEX_NAME_KEY, "fk_child_idx");
ckIndexValuesMap.put(ST_TABLE_NAME_KEY, localTableName);
}