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 bindListSecondPass(Element, List, java.util.Map, Mappings, java.util.Map)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 11 | |||
1 | if ( list.isOneToMany() && !list.getKey().isNullable() && !list.isInverse() ) {↵ | |||
1 | String entityName = ( (OneToMany) collection.getElement() ).getReferencedEntityName();↵ | 2 | String entityName = ( (OneToMany) list.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( '_' + list.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( list.getRole() );↵ | |
8 | prop.setEntityName( collection.getOwner().getEntityName() );↵ | 9 | ib.setEntityName( list.getOwner().getEntityName() );↵ | |
9 | prop.setValue( collection.getKey() ↵ | 10 | ib.setValue( list.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(); |
| 14 | String entityName = ((OneToMany)list.getElement()).getReferencedEntityName(); | |||||||||||||||||||||||
56 | PersistentClass referenced = mappings.getClass(entityName); | 15 | PersistentClass referenced = mappings.getClass(entityName); | ||||||||||||||||||||||||
57 | Backref prop = new Backref(); |
| 16 | IndexBackref ib = new IndexBackref(); | |||||||||||||||||||||||
58 | prop.setName('_' + collection.getOwnerEntityName() + "." + node.attributeValue("name") + "Backref"); |
| 21 | ib.setEntityName(list.getOwner().getEntityName()); | |||||||||||||||||||||||
59 | prop.setUpdateable(false); |
| 18 | ib.setUpdateable(false); | |||||||||||||||||||||||
60 | prop.setSelectable(false); |
| 19 | ib.setSelectable(false); | |||||||||||||||||||||||
61 | prop.setCollectionRole(collection.getRole()); |
| 20 | ib.setCollectionRole(list.getRole()); | |||||||||||||||||||||||
62 | prop.setEntityName(collection.getOwner().getEntityName()); |
| 17 | ib.setName('_' + list.getOwnerEntityName() + "." + node.attributeValue("name") + "IndexBackref"); | |||||||||||||||||||||||
| 22 | ib.setValue(list.getIndex()); | |||||||||||||||||||||||||
63 | prop.setValue(collection.getKey()); | | |||||||||||||||||||||||||
64 | referenced.addProperty(prop); |
| 23 | 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(list.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(list.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('_' + list.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('_' + list.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 |