File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/reattachment/CollectionReattachmentTest.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/reattachment/CollectionReattachmentTest.java | |||
Method name: void testUpdateOwnerAfterEvict()
|
Method name: void testUpdateOwnerAfterClear()
|
|||
Number of AST nodes: 19 | Number of AST nodes: 19 | |||
1 | Session s = openSession();↵ | 1 | Session s = openSession();↵ | |
2 | s.beginTransaction();↵ | 2 | s.beginTransaction();↵ | |
3 | Parent p = new Parent( "p" );↵ | 3 | Parent p = new Parent( "p" );↵ | |
4 | p.getChildren().add( new Child( "c" ) );↵ | 4 | p.getChildren().add( new Child( "c" ) );↵ | |
5 | s.save( p );↵ | 5 | s.save( p );↵ | |
6 | s.getTransaction().commit();↵ | 6 | s.getTransaction().commit();↵ | |
7 | s.close();↵ | 7 | s.close();↵ | |
8 | s = openSession();↵ | 8 | s = openSession();↵ | |
9 | s.beginTransaction();↵ | 9 | s.beginTransaction();↵ | |
10 | p = ( Parent ) s.get( Parent.class, "p" );↵ | 10 | p = ( Parent ) s.get( Parent.class, "p" );↵ | |
11 | // evict...↵ | 11 | // clear...↵ | |
12 | s.evict( p );↵ | 12 | s.clear();↵ | |
13 | // now try to reattach...↵ | 13 | // now try to reattach...↵ | |
14 | s.update( p );↵ | 14 | s.update( p );↵ | |
15 | s.getTransaction().commit();↵ | 15 | s.getTransaction().commit();↵ | |
16 | s.close();↵ | 16 | s.close();↵ | |
17 | s = openSession();↵ | 17 | s = openSession();↵ | |
18 | s.beginTransaction();↵ | 18 | s.beginTransaction();↵ | |
19 | s.delete( p );↵ | 19 | s.delete( p );↵ | |
20 | s.getTransaction().commit();↵ | 20 | s.getTransaction().commit();↵ | |
21 | s.close(); | 21 |
| |
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 81 |
Number of mapped statements | 19 |
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.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Session s = openSession(); | 1 | Session s = openSession(); | ||||||||||||||||||||||
2 | s.beginTransaction(); | 2 | s.beginTransaction(); | ||||||||||||||||||||||
3 | Parent p = new Parent("p"); | 3 | Parent p = new Parent("p"); | ||||||||||||||||||||||
4 | p.getChildren().add(new Child("c")); | 4 | p.getChildren().add(new Child("c")); | ||||||||||||||||||||||
5 | s.save(p); | 5 | s.save(p); | ||||||||||||||||||||||
6 | s.getTransaction().commit(); | 6 | s.getTransaction().commit(); | ||||||||||||||||||||||
7 | s.close(); | 7 | s.close(); | ||||||||||||||||||||||
8 | s = openSession(); | 8 | s = openSession(); | ||||||||||||||||||||||
9 | s.beginTransaction(); | 9 | s.beginTransaction(); | ||||||||||||||||||||||
10 | p = (Parent)s.get(Parent.class, "p"); | 10 | p = (Parent)s.get(Parent.class, "p"); | ||||||||||||||||||||||
11 | s.evict(p); |
| 12 | s.update(p); | |||||||||||||||||||||
12 | s.update(p); |
| 11 | s.clear(); | |||||||||||||||||||||
13 | s.getTransaction().commit(); | 13 | s.getTransaction().commit(); | ||||||||||||||||||||||
14 | s.close(); | 14 | s.close(); | ||||||||||||||||||||||
15 | s = openSession(); | 15 | s = openSession(); | ||||||||||||||||||||||
16 | s.beginTransaction(); | 16 | s.beginTransaction(); | ||||||||||||||||||||||
17 | s.delete(p); | 17 | s.delete(p); | ||||||||||||||||||||||
18 | s.getTransaction().commit(); | 18 | s.getTransaction().commit(); | ||||||||||||||||||||||
19 | s.close(); | 19 | s.close(); |
Row | Violation |
---|---|
1 | Expression s.evict(p) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression s.update(p) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression s.evict(p) is a void method call, and thus it cannot be parameterized |
4 | Expression s.update(p) is a void method call, and thus it cannot be parameterized |
5 | Expression s.update(p) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression s.clear() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression s.update(p) is a void method call, and thus it cannot be parameterized |
8 | Expression s.clear() is a void method call, and thus it cannot be parameterized |
9 | Expression s.update(p) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression s.clear() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression s.update(p) is a void method call, and thus it cannot be parameterized |
12 | Expression s.clear() is a void method call, and thus it cannot be parameterized |