File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/criterion/NotNullExpression.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/criterion/NullExpression.java | |||
Method name: String toSqlString(Criteria, CriteriaQuery)
|
Method name: String toSqlString(Criteria, CriteriaQuery)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | String[] columns = criteriaQuery.getColumnsUsingProjection(criteria, propertyName);↵ | 1 | String[] columns = criteriaQuery.getColumnsUsingProjection(criteria, propertyName);↵ | |
2 | String result = StringHelper.join(↵ | 2 | String result = StringHelper.join(↵ | |
3 | " or ",↵ | 3 | " and ",↵ | |
4 | StringHelper.suffix( columns, " is not null" )↵ | 4 | StringHelper.suffix( columns, " is null" )↵ | |
5 | );↵ | 5 | );↵ | |
6 | if (columns.length>1) result = '(' + result + ')';↵ | 6 | if (columns.length>1) result = '(' + result + ')';↵ | |
7 | return result; | 7 |
| |
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 13 |
Number of mapped statements | 5 |
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) | 0.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String[] columns = criteriaQuery.getColumnsUsingProjection(criteria, propertyName); | 1 | String[] columns = criteriaQuery.getColumnsUsingProjection(criteria, propertyName); | ||||||||||||||
2 | String result = StringHelper.join(" or ", StringHelper.suffix(columns, " is not null")); |
| 2 | String result = StringHelper.join(" and ", StringHelper.suffix(columns, " is null")); | |||||||||||||
3 | if (columns.length > 1) | 3 | if (columns.length > 1) | ||||||||||||||
4 | result = '(' + result + ')'; | 4 | result = '(' + result + ')'; | ||||||||||||||
5 | return result; | 5 | return result; |
Row | Violation |
---|