File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/SQLFunctionsTest.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/dialect/functional/cache/SQLFunctionsInterSystemsTest.java | |||
Method name: void testSQLFunctions()
|
Method name: void testSQLFunctions()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | if ( ! (getDialect() instanceof MySQLDialect) && ! (getDialect() instanceof HSQLDialect) ) { //My SQL has no subqueries↵ | 1 | if ( ! (getDialect() instanceof MySQLDialect) && ! (getDialect() instanceof HSQLDialect) ) { //My SQL has no subqueries ↵ | |
2 | assertTrue(↵ | 2 | assertTrue( ↵ | |
3 | s.find("from Simple s where s.count > ( select min(sim.count) from Simple sim )").size()==2↵ | 3 | s.find("from Simple s where s.count > ( select min(sim.count) from Simple sim )").size()==2 ↵ | |
4 | );↵ | 4 | ); ↵ | |
5 | t.commit();↵ | 5 | t.commit(); ↵ | |
6 | t = s.beginTransaction();↵ | 6 | t = s.beginTransaction(); ↵ | |
7 | assertTrue(↵ | 7 | assertTrue( ↵ | |
8 | s.find("from Simple s where s = some( select sim from Simple sim where sim.count>=0 ) and s.count >= 0").size()==2↵ | 8 | s.find("from Simple s where s = some( select sim from Simple sim where sim.count>=0 ) and s.count >= 0").size()==2 ↵ | |
9 | );↵ | 9 | ); ↵ | |
10 | assertTrue(↵ | 10 | assertTrue( ↵ | |
11 | s.find("from Simple s where s = some( select sim from Simple sim where sim.other.count=s.other.count ) and s.other.count > 0").size()==1↵ | 11 | s.find("from Simple s where s = some( select sim from Simple sim where sim.other.count=s.other.count ) and s.other.count > 0").size()==1 ↵ | |
12 | );↵ | 12 | ); ↵ | |
13 | } | 13 |
| |
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 36 |
Number of mapped statements | 6 |
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) | 5.8 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
31 | if (!(getDialect() instanceof MySQLDialect) && !(getDialect() instanceof HSQLDialect)) | 29 | if (!(getDialect() instanceof MySQLDialect) && !(getDialect() instanceof HSQLDialect)) | |
32 | assertTrue(s.find("from Simple s where s.count > ( select min(sim.count) from Simple sim )").size() == 2); | 30 | assertTrue(s.find("from Simple s where s.count > ( select min(sim.count) from Simple sim )").size() == 2); | |
33 | t.commit(); | 31 | t.commit(); | |
34 | t = s.beginTransaction(); | 32 | t = s.beginTransaction(); | |
35 | assertTrue(s.find("from Simple s where s = some( select sim from Simple sim where sim.count>=0 ) and s.count >= 0").size() == 2); | 33 | assertTrue(s.find("from Simple s where s = some( select sim from Simple sim where sim.count>=0 ) and s.count >= 0").size() == 2); | |
36 | assertTrue(s.find("from Simple s where s = some( select sim from Simple sim where sim.other.count=s.other.count ) and s.other.count > 0").size() == 1); | 34 | assertTrue(s.find("from Simple s where s = some( select sim from Simple sim where sim.other.count=s.other.count ) and s.other.count > 0").size() == 1); |
Row | Violation |
---|