File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/EntityIdentityInsertAction.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/JoinSequence.java | |||
Method name: void execute()
|
Method name: JoinFragment toJoinFragment(Map, boolean, String, String)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 5 | |||
1 | generatedId = persister.insert( state, instance, session );↵ | |||
2 | if ( persister.hasInsertGeneratedProperties() ) {↵ | |||
3 | persister.processInsertGeneratedProperties( generatedId, instance, state, session );↵ | |||
4 | }↵ | |||
5 | //need to do that here rather than in the save event listener to let↵ | |||
6 | //the post insert events to have a id-filled entity when IDENTITY is used (EJB3)↵ | |||
7 | persister.setIdentifier( instance, generatedId, session.getEntityMode() ); | 1 | joinFragment.addCrossJoin( rootJoinable.getTableName(), rootAlias );↵ | |
2 | String filterCondition = rootJoinable.filterFragment( rootAlias, enabledFilters );↵ | |||
3 | // JoinProcessor needs to know if the where clause fragment came from a dynamic filter or not so it↵ | |||
4 | // can put the where clause fragment in the right place in the SQL AST. 'hasFilterCondition' keeps track↵ | |||
5 | // of that fact.↵ | |||
6 | joinFragment.setHasFilterCondition( joinFragment.addCondition( filterCondition ) );↵ | |||
7 | if (includeExtraJoins) { //TODO: not quite sure about the full implications of this!↵ | |||
8 | addExtraJoins( joinFragment, rootAlias, rootJoinable, true );↵ | |||
9 |
| |||
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 11 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 53.3 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 3 | joinFragment.addCrossJoin(rootJoinable.getTableName(), rootAlias); | ||||||||||||
| 4 | String filterCondition = rootJoinable.filterFragment(rootAlias, enabledFilters); | ||||||||||||
|
| 5 | joinFragment.setHasFilterCondition(joinFragment.addCondition(filterCondition)); | |||||||||||
6 | generatedId = persister.insert(state, instance, session); |
| | |||||||||||
7 | if (persister.hasInsertGeneratedProperties()) |
| 6 | if (includeExtraJoins) | ||||||||||
| 7 | addExtraJoins(joinFragment, rootAlias, rootJoinable, true); | ||||||||||||
8 | persister.processInsertGeneratedProperties(generatedId, instance, state, session); |
| | |||||||||||
9 | persister.setIdentifier(instance, generatedId, session.getEntityMode()); |
| |
Row | Violation |
---|---|
1 | Unmatched statement joinFragment.setHasFilterCondition(joinFragment.addCondition(filterCondition)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement generatedId=persister.insert(state,instance,session); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement persister.processInsertGeneratedProperties(generatedId,instance,state,session); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched statement persister.setIdentifier(instance,generatedId,session.getEntityMode()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |