File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/id/SelectGenerator.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java | |||
Method name: Serializable getResult(SessionImplementor, ResultSet, Object)
|
Method name: int writeIndexToWhere(PreparedStatement, Object, int, SessionImplementor)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 4 | |||
1 | if ( !rs.next() ) {↵ | 1 | if (indexContainsFormula) {↵ | |
2 | throw new IdentifierGenerationException(↵ | 2 | throw new Assertion↵ | |
3 | "the inserted row could not be located by the unique key: " +↵ | |||
4 | uniqueKeyPropertyName↵ | |||
5 | );↵ | 3 | Failure("cannot use a formula-based index in the where condition");↵ | |
6 | }↵ | 4 | }↵ | |
7 | return ( Serializable ) idType.nullSafeGet(↵ | 5 | getIndexType().nullSafeSet(↵ | |
8 | rs,↵ | |||
9 | persister.getRootTableKeyColumnNames(),↵ | |||
10 | session,↵ | |||
11 | entity↵ | |||
12 | )↵ | 6 | st, incrementIndexByBase(index), i, session );↵ | |
13 | ; | 7 | return i + indexColumnAliases.length; | |
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 | 6 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (!rs.next()) |
| 1 | if (indexContainsFormula) | |||||||||||||
2 | throw new IdentifierGenerationException("the inserted row could not be located by the unique key: " + uniqueKeyPropertyName); |
| 2 | throw new AssertionFailure("cannot use a formula-based index in the where condition"); | |||||||||||||
| 3 | getIndexType().nullSafeSet(st, incrementIndexByBase(index), i, session); | |||||||||||||||
3 | return (Serializable)idType.nullSafeGet(rs, persister.getRootTableKeyColumnNames(), session, entity); |
| | ||||||||||||||
|
| 4 | return i + indexColumnAliases.length; |
Row | Violation |
---|---|
1 | Unmatched return (Serializable)idType.nullSafeGet(rs,persister.getRootTableKeyColumnNames(),session,entity); |
2 | Unmatched return i + indexColumnAliases.length; |