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 bindCollectionSecondPass(Element, Collection, java.util.Map, Mappings, java.util.Map)
|
Method name: void bindMapSecondPass(Element, Map, java.util.Map, Mappings, java.util.Map)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 11 | |||
1 | if ( map.isOneToMany() && !map.getKey().isNullable() && !map.isInverse() && !indexIsFormula ) {↵ | |||
1 | String entityName = ( (OneToMany) collection.getElement() ).getReferencedEntityName();↵ | 2 | String entityName = ( (OneToMany) map.getElement() ).getReferencedEntityName();↵ | |
2 | PersistentClass referenced = mappings.getClass( entityName );↵ | 3 | PersistentClass referenced = mappings.getClass( entityName );↵ | |
3 | Backref prop = new Backref();↵ | 4 | IndexBackref ib = new IndexBackref();↵ | |
4 | prop.setName( '_' + collection.getOwnerEntityName() + "." + node.attributeValue( "name" ) + "Backref" );↵ | 5 | ib.setName( '_' + map.getOwnerEntityName() + "." + node.attributeValue( "name" ) + "IndexBackref" );↵ | |
5 | prop.setUpdateable( false );↵ | 6 | ib.setUpdateable( false );↵ | |
6 | prop.setSelectable( false );↵ | 7 | ib.setSelectable( false );↵ | |
7 | prop.setCollectionRole( collection.getRole() );↵ | 8 | ib.setCollectionRole( map.getRole() );↵ | |
8 | prop.setEntityName( collection.getOwner().getEntityName() );↵ | 9 | ib.setEntityName( map.getOwner().getEntityName() );↵ | |
9 | prop.setValue( collection.getKey() ↵ | 10 | ib.setValue( map.getIndex() );↵ | |
11 | // ( (Column) ( (SimpleValue) ic.getIndex() ).getColumnIterator().next()↵ | |||
10 | );↵ | 12 | // ).setNullable(false);↵ | |
11 | referenced.addProperty( prop ); | 13 | referenced.addProperty( ib );↵ | |
14 |
| |||
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 72 |
Number of mapped statements | 9 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
55 | String entityName = ((OneToMany)collection.getElement()).getReferencedEntityName(); |
| 31 | String entityName = ((OneToMany)map.getElement()).getReferencedEntityName(); | |||||||||||||||||||||||
56 | PersistentClass referenced = mappings.getClass(entityName); | 32 | PersistentClass referenced = mappings.getClass(entityName); | ||||||||||||||||||||||||
57 | Backref prop = new Backref(); |
| 33 | IndexBackref ib = new IndexBackref(); | |||||||||||||||||||||||
58 | prop.setName('_' + collection.getOwnerEntityName() + "." + node.attributeValue("name") + "Backref"); |
| 38 | ib.setEntityName(map.getOwner().getEntityName()); | |||||||||||||||||||||||
59 | prop.setUpdateable(false); |
| 35 | ib.setUpdateable(false); | |||||||||||||||||||||||
60 | prop.setSelectable(false); |
| 36 | ib.setSelectable(false); | |||||||||||||||||||||||
61 | prop.setCollectionRole(collection.getRole()); |
| 37 | ib.setCollectionRole(map.getRole()); | |||||||||||||||||||||||
62 | prop.setEntityName(collection.getOwner().getEntityName()); |
| 34 | ib.setName('_' + map.getOwnerEntityName() + "." + node.attributeValue("name") + "IndexBackref"); | |||||||||||||||||||||||
| 39 | ib.setValue(map.getIndex()); | |||||||||||||||||||||||||
63 | prop.setValue(collection.getKey()); | | |||||||||||||||||||||||||
64 | referenced.addProperty(prop); |
| 40 | referenced.addProperty(ib); |
Row | Violation |
---|---|
1 | Expression prop.setName('_' + collection.getOwnerEntityName() + "."+ node.attributeValue("name")+ "Backref") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression ib.setEntityName(map.getOwner().getEntityName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression prop.setName('_' + collection.getOwnerEntityName() + "."+ node.attributeValue("name")+ "Backref") is a void method call, and thus it cannot be parameterized |
4 | Expression ib.setEntityName(map.getOwner().getEntityName()) is a void method call, and thus it cannot be parameterized |
5 | Expression prop cannot be unified with expression ib , because common superclass org.hibernate.mapping.Property does not declare member(s) public void setCollectionRole(java.lang.String) |
6 | Expression prop.setEntityName(collection.getOwner().getEntityName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression ib.setName('_' + map.getOwnerEntityName() + "."+ node.attributeValue("name")+ "IndexBackref") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression prop.setEntityName(collection.getOwner().getEntityName()) is a void method call, and thus it cannot be parameterized |
9 | Expression ib.setName('_' + map.getOwnerEntityName() + "."+ node.attributeValue("name")+ "IndexBackref") is a void method call, and thus it cannot be parameterized |
10 | Clone fragment #1 returns variable prop with type org.hibernate.mapping.Backref , while Clone fragment #2 returns variable ib with type org.hibernate.mapping.IndexBackref |