File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/HbmBinder.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/HbmBinder.java | |||
Method name: void bindMapSecondPass(Element, Map, java.util.Map, Mappings, java.util.Map)
|
Method name: void bindListSecondPass(Element, List, java.util.Map, Mappings, java.util.Map)
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | if ( map.isOneToMany() && !map.getKey().isNullable() && !map.isInverse() && !indexIsFormula ) {↵ | 1 | if ( list.isOneToMany() && !list.getKey().isNullable() && !list.isInverse() ) {↵ | |
2 | String entityName = ( (OneToMany) map.getElement() ).getReferencedEntityName();↵ | 2 | String entityName = ( (OneToMany) list.getElement() ).getReferencedEntityName();↵ | |
3 | PersistentClass referenced = mappings.getClass( entityName );↵ | 3 | PersistentClass referenced = mappings.getClass( entityName );↵ | |
4 | IndexBackref ib = new IndexBackref();↵ | 4 | IndexBackref ib = new IndexBackref();↵ | |
5 | ib.setName( '_' + map.getOwnerEntityName() + "." + node.attributeValue( "name" ) + "IndexBackref" );↵ | 5 | ib.setName( '_' + list.getOwnerEntityName() + "." + node.attributeValue( "name" ) + "IndexBackref" );↵ | |
6 | ib.setUpdateable( false );↵ | 6 | ib.setUpdateable( false );↵ | |
7 | ib.setSelectable( false );↵ | 7 | ib.setSelectable( false );↵ | |
8 | ib.setCollectionRole( map.getRole() );↵ | 8 | ib.setCollectionRole( list.getRole() );↵ | |
9 | ib.setEntityName( map.getOwner().getEntityName() );↵ | 9 | ib.setEntityName( list.getOwner().getEntityName() );↵ | |
10 | ib.setValue( map.getIndex() );↵ | 10 | ib.setValue( list.getIndex() );↵ | |
11 | // ( (Column) ( (SimpleValue) ic.getIndex() ).getColumnIterator().next()↵ | 11 | // ( (Column) ( (SimpleValue) ic.getIndex() ).getColumnIterator().next()↵ | |
12 | // ).setNullable(false);↵ | 12 | // ).setNullable(false);↵ | |
13 | referenced.addProperty( ib );↵ | 13 | referenced.addProperty( ib );↵ | |
14 | } | 14 |
| |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 121 |
Number of mapped statements | 11 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 7.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
30 | if (map.isOneToMany() && !map.getKey().isNullable() && !map.isInverse() && !indexIsFormula) |
| 13 | if (list.isOneToMany() && !list.getKey().isNullable() && !list.isInverse()) | ||||||||||||||||||||||
31 | String entityName = ((OneToMany)map.getElement()).getReferencedEntityName(); |
| 14 | String entityName = ((OneToMany)list.getElement()).getReferencedEntityName(); | ||||||||||||||||||||||
32 | PersistentClass referenced = mappings.getClass(entityName); | 15 | PersistentClass referenced = mappings.getClass(entityName); | |||||||||||||||||||||||
33 | IndexBackref ib = new IndexBackref(); | 16 | IndexBackref ib = new IndexBackref(); | |||||||||||||||||||||||
34 | ib.setName('_' + map.getOwnerEntityName() + "." + node.attributeValue("name") + "IndexBackref"); |
| 17 | ib.setName('_' + list.getOwnerEntityName() + "." + node.attributeValue("name") + "IndexBackref"); | ||||||||||||||||||||||
35 | ib.setUpdateable(false); | 18 | ib.setUpdateable(false); | |||||||||||||||||||||||
36 | ib.setSelectable(false); | 19 | ib.setSelectable(false); | |||||||||||||||||||||||
37 | ib.setCollectionRole(map.getRole()); |
| 20 | ib.setCollectionRole(list.getRole()); | ||||||||||||||||||||||
38 | ib.setEntityName(map.getOwner().getEntityName()); |
| 21 | ib.setEntityName(list.getOwner().getEntityName()); | ||||||||||||||||||||||
39 | ib.setValue(map.getIndex()); |
| 22 | ib.setValue(list.getIndex()); | ||||||||||||||||||||||
40 | referenced.addProperty(ib); | 23 | referenced.addProperty(ib); |
Row | Violation |
---|