File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/manytomanyassociationclass/surrogateid/generated/ManyToManyAssociationClassGeneratedIdTest.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/manytomanyassociationclass/surrogateid/generated/ManyToManyAssociationClassGeneratedIdTest.java | |||
Method name: void testRemoveAndAddEqualCollection()
|
Method name: void testRemoveAndAddEqualElementNonKeyModified()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | try {↵ | 1 | try {↵ | |
2 | // The new membership is transient (it has a null surrogate ID), so↵ | 2 | // The new membership is transient (it has a null surrogate ID), so↵ | |
3 | // Hibernate assumes that it should be added to the collection.↵ | 3 | // Hibernate assumes that it should be added to the collection.↵ | |
4 | // Inserts are done before deletes, so a ConstraintViolationException↵ | 4 | // Inserts are done before deletes, so a ConstraintViolationException↵ | |
5 | // will be thrown on the insert because the unique constraint on the↵ | 5 | // will be thrown on the insert because the unique constraint on the↵ | |
6 | // user and group IDs in the join table is violated. See HHH-2801.↵ | 6 | // user and group IDs in the join table is violated. See HHH-2801.↵ | |
7 | s.merge( getUser() );↵ | 7 | s.merge( getUser() );↵ | |
8 | s.getTransaction().commit();↵ | 8 | s.getTransaction().commit();↵ | |
9 | fail( "should have failed because inserts are before deletes");↵ | 9 | fail( "should have failed because inserts are before deletes");↵ | |
10 | }↵ | 10 | }↵ | |
11 | catch( ConstraintViolationException ex ) {↵ | 11 | catch( ConstraintViolationException ex ) {↵ | |
12 | // expected↵ | 12 | // expected↵ | |
13 | s.getTransaction().rollback();↵ | 13 | s.getTransaction().rollback();↵ | |
14 | }↵ | 14 | }↵ | |
15 | finally {↵ | 15 | finally {↵ | |
16 | s.close();↵ | 16 | s.close();↵ | |
17 | } | 17 |
| |
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 declared in the same class |
Number of node comparisons | 16 |
Number of mapped statements | 4 |
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 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
7 | try | 7 | try | |
8 | s.merge(getUser()); | 8 | s.merge(getUser()); | |
9 | s.getTransaction().commit(); | 9 | s.getTransaction().commit(); | |
10 | fail("should have failed because inserts are before deletes"); | 10 | fail("should have failed because inserts are before deletes"); |
Row | Violation |
---|