public void testNestedCollectionFetch() { Session s = openSession(); Transaction t = s.beginTransaction(); s.createQuery("from Animal a left join fetch a.offspring o left join fetch o.offspring where a.mother.id = 1 order by a.description").list(); s.createQuery("from Zoo z left join fetch z.animals a left join fetch a.offspring where z.name ='MZ' order by a.description").list(); s.createQuery("from Human h left join fetch h.pets a left join fetch a.offspring where h.name.first ='Gavin' order by a.description").list(); 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/ASTParserLoadingTest.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 testNestedCollectionFetch() {
1
private void cleanup() {
2
		Session s = openSession();
2
			Session s = openSession();
3
		Transaction t = s.beginTransaction();
3
			Transaction txn = s.beginTransaction();
4
		
4
			
5
s.createQuery("from Animal a left join fetch a.offspring o left join fetch o.offspring where a.mother.id = 1 order by a.description").list();
5
			s.createQuery( "delete Animal where description like 'grand%'" ).executeUpdate();
6
		s.createQuery("from Zoo z left join fetch z.animals a left join fetch a.offspring where z.name ='MZ' order by a.description").list();
6
			s.createQuery( "delete Animal where not description like 'root%'" ).executeUpdate();
7
		s.createQuery("from Human h left join fetch h.pets a left join fetch a.offspring where h.name.first ='Gavin' order by a.description").list();
7
			s.createQuery( "delete Animal" ).executeUpdate();
8
		t.commit();
8
			txn.commit();
9
		s.close();
9
			s.close();
10
	
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