public void testDeleteSyntaxWithCompositeId() { Session s = openSession(); Transaction t = s.beginTransaction(); s.createQuery( "delete EntityWithCrazyCompositeKey where id.id = 1 and id.otherId = 2" ).executeUpdate(); s.createQuery( "delete from EntityWithCrazyCompositeKey where id.id = 1 and id.otherId = 2" ).executeUpdate(); s.createQuery( "delete from EntityWithCrazyCompositeKey e where e.id.id = 1 and e.id.otherId = 2" ).executeUpdate(); t.commit(); s.close();
private void cleanup() { Session s = openSession(); Transaction txn = s.beginTransaction(); s.createQuery( "delete Animal where description like 'grand%'" ).executeUpdate(); s.createQuery( "delete Animal where not description like 'root%'" ).executeUpdate(); s.createQuery( "delete Animal" ).executeUpdate(); txn.commit(); s.close();
Clone fragments detected by clone detection tool
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/ScrollableCollectionFetchingTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public void testDeleteSyntaxWithCompositeId() {
1
private void cleanup() {
2
		Session s = openSession();
2
			Session s = openSession();
3
		Transaction t = s.beginTransaction();
3
			Transaction txn = s.beginTransaction();
4
			
4
		s.createQuery( "delete EntityWithCrazyCompositeKey where id.id = 1 and id.otherId = 2" ).executeUpdate();
5
			s.createQuery( "delete Animal where description like 'grand%'" ).executeUpdate();
5
		s.createQuery( "delete from EntityWithCrazyCompositeKey where id.id = 1 and id.otherId = 2" ).executeUpdate();
6
			s.createQuery( "delete Animal where not description like 'root%'" ).executeUpdate();
6
		s.createQuery( "delete from EntityWithCrazyCompositeKey e where e.id.id = 1 and e.id.otherId = 2" ).executeUpdate();
7
			s.createQuery( "delete Animal" ).executeUpdate();
7
		t.commit();
8
			txn.commit();
8
		s.close();
9
			s.close();
9
	
10
		
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0