File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/dialects/H2DialectExt.java | File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/dialects/MAXDBDialectExt.java | |||
Method name: String[] getAddForeignKeyConstraintSQL(String, String, String, Boolean, Boolean, Boolean, boolean, String, Collection
|
Method name: String[] getAddForeignKeyConstraintSQL(String, String, String, Boolean, Boolean, Boolean, boolean, String, Collection
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | StringTemplate fkST = new StringTemplate(ST_ADD_FOREIGN_KEY_CONSTRAINT_STYLE_ONE);↵ | 1 | final StringTemplate fkST = new StringTemplate(ST_ADD_FOREIGN_KEY_CONSTRAINT_STYLE_ONE);↵ | |
2 | HashMap<String, String> fkValuesMap = ↵ | 2 | final HashMap<String, String> fkValuesMap =↵ | |
3 | DialectUtils.getValuesMap(ST_CHILD_TABLE_KEY, localTableName);↵ | 3 | DialectUtils.getValuesMap(ST_CHILD_TABLE_KEY, localTableName);↵ | |
4 | fkValuesMap.put(ST_CONSTRAINT_KEY, "CONSTRAINT");↵ | 4 | fkValuesMap.put(ST_CONSTRAINT_KEY, "CONSTRAINT");↵ | |
5 | fkValuesMap.put(ST_CONSTRAINT_NAME_KEY, constraintName);↵ | 5 | fkValuesMap.put(ST_CONSTRAINT_NAME_KEY, constraintName);↵ | |
6 | fkValuesMap.put(ST_PARENT_TABLE_KEY, refTableName);↵ | 6 | fkValuesMap.put(ST_PARENT_TABLE_KEY, refTableName);↵ | |
7 | StringTemplate childIndexST = null;↵ | 7 | StringTemplate childIndexST = null;↵ | |
8 | HashMap<String, String> ckIndexValuesMap = null;↵ | 8 | HashMap<String, String> ckIndexValuesMap = null;↵ | |
9 | if (autoFKIndex)↵ | 9 | if (autoFKIndex)↵ | |
10 | {↵ | 10 | {↵ | |
11 | // "CREATE $unique$ $storageOption$ INDEX $indexName$ " +↵ | 11 | // "CREATE $unique$ $storageOption$ INDEX $indexName$ " +↵ | |
12 | // "ON $tableName$ ( $columnName; separator=\",\"$ )";↵ | 12 | // "ON $tableName$ ( $columnName; separator=\",\"$ )";↵ | |
13 | childIndexST = new StringTemplate(ST_CREATE_INDEX_STYLE_TWO);↵ | 13 | childIndexST = new StringTemplate(ST_CREATE_INDEX_STYLE_TWO);↵ | |
14 | ckIndexValuesMap = new HashMap<String, String>();↵ | 14 | ckIndexValuesMap = new HashMap<String, String>();↵ | |
15 | ckIndexValuesMap.put(ST_INDEX_NAME_KEY, "fk_child_idx");↵ | 15 | ckIndexValuesMap.put(ST_INDEX_NAME_KEY, "fk_child_idx");↵ | |
16 | }↵ | 16 | }↵ | |
17 | return DialectUtils.getAddForeignKeyConstraintSQL(fkST, fkValuesMap, childIndexST, ckIndexValuesMap,↵ | 17 | return DialectUtils.getAddForeignKeyConstraintSQL(fkST, fkValuesMap, childIndexST, ckIndexValuesMap,↵ | |
18 | localRefColumns, qualifier, prefs, this); | 18 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 80 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 9.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
| 1 | final StringTemplate fkST = new StringTemplate(ST_ADD_FOREIGN_KEY_CONSTRAINT_STYLE_ONE); | ||
1 | StringTemplate fkST = new StringTemplate(ST_ADD_FOREIGN_KEY_CONSTRAINT_STYLE_ONE); | | ||
| 2 | final HashMap<String, String> fkValuesMap = DialectUtils.getValuesMap(ST_CHILD_TABLE_KEY, localTableName); | ||
2 | HashMap<String, String> fkValuesMap = DialectUtils.getValuesMap(ST_CHILD_TABLE_KEY, localTableName); | | ||
3 | fkValuesMap.put(ST_CONSTRAINT_KEY, "CONSTRAINT"); | 3 | fkValuesMap.put(ST_CONSTRAINT_KEY, "CONSTRAINT"); | |
4 | fkValuesMap.put(ST_CONSTRAINT_NAME_KEY, constraintName); | 4 | fkValuesMap.put(ST_CONSTRAINT_NAME_KEY, constraintName); | |
5 | fkValuesMap.put(ST_PARENT_TABLE_KEY, refTableName); | 5 | fkValuesMap.put(ST_PARENT_TABLE_KEY, refTableName); | |
6 | StringTemplate childIndexST = null; | 6 | StringTemplate childIndexST = null; | |
7 | HashMap<String, String> ckIndexValuesMap = null; | 7 | HashMap<String, String> ckIndexValuesMap = null; | |
8 | if (autoFKIndex) | 8 | if (autoFKIndex) | |
9 | childIndexST = new StringTemplate(ST_CREATE_INDEX_STYLE_TWO); | 9 | childIndexST = new StringTemplate(ST_CREATE_INDEX_STYLE_TWO); | |
10 | ckIndexValuesMap = new HashMap<String, String>(); | 10 | ckIndexValuesMap = new HashMap<String, String>(); | |
11 | ckIndexValuesMap.put(ST_INDEX_NAME_KEY, "fk_child_idx"); | 11 | ckIndexValuesMap.put(ST_INDEX_NAME_KEY, "fk_child_idx"); | |
12 | return DialectUtils.getAddForeignKeyConstraintSQL(fkST, fkValuesMap, childIndexST, ckIndexValuesMap, localRefColumns, qualifier, prefs, this); | 12 | return DialectUtils.getAddForeignKeyConstraintSQL(fkST, fkValuesMap, childIndexST, ckIndexValuesMap, localRefColumns, qualifier, prefs, this); |
Row | Violation |
---|