File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/hql/BulkManipulationTest.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/hql/BulkManipulationTest.java | |||
Method name: void testDeleteNonExistentEntity()
|
Method name: void testUpdateNonExistentEntity()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | Session s = openSession();↵ | 1 | Session s = openSession();↵ | |
2 | Transaction t = s.beginTransaction();↵ | 2 | Transaction t = s.beginTransaction();↵ | |
3 | try {↵ | 3 | try {↵ | |
4 | s.createQuery( "delete NonExistentEntity" ).executeUpdate();↵ | 4 | s.createQuery( "update NonExistentEntity e set e.someProp = ?" ).executeUpdate();↵ | |
5 | fail( "no exception thrown" );↵ | 5 | fail( "no exception thrown" );↵ | |
6 | }↵ | 6 | }↵ | |
7 | catch( QueryException e ) {↵ | 7 | catch( QueryException e ) {↵ | |
8 | log.debug( "Caught expected error type : " + e.getMessage() );↵ | 8 | log.debug( "Caught expected error type : " + e.getMessage() );↵ | |
9 | }↵ | 9 | }↵ | |
10 | t.commit();↵ | 10 | t.commit();↵ | |
11 | s.close(); | 11 |
| |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 17 |
Number of mapped statements | 7 |
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) | 17.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Session s = openSession(); | 1 | Session s = openSession(); | |||||||||||
2 | Transaction t = s.beginTransaction(); | 2 | Transaction t = s.beginTransaction(); | |||||||||||
3 | try | 3 | try | |||||||||||
4 | s.createQuery("delete NonExistentEntity").executeUpdate(); |
| 4 | s.createQuery("update NonExistentEntity e set e.someProp = ?").executeUpdate(); | ||||||||||
5 | fail("no exception thrown"); | 5 | fail("no exception thrown"); | |||||||||||
6 | t.commit(); | 6 | t.commit(); | |||||||||||
7 | s.close(); | 7 | s.close(); |
Row | Violation |
---|