Session s = openSession(); Transaction t = s.beginTransaction(); Person p = new Person(); p.setName("Steve"); p.setUserId("steve"); Address a = new Address(); a.setAddress("Texas"); a.setCountry("USA"); p.setAddress(a); a.setPerson(p); s.save(p); Person p2 = new Person(); p2.setName("Max"); p2.setUserId("max"); s.save(p2); Account act = new Account(); act.setType('c'); act.setUser(p2); p2.getAccounts().add(act); s.save(act); s.flush(); s.clear(); p = (Person) s.get( Person.class, p.getId() ); //get address reference by outer join p2 = (Person) s.get( Person.class, p2.getId() ); //get null address reference by outer join assertNull( p2.getAddress() ); assertNotNull( p.getAddress() ); List l = s.createQuery("from Person").list(); //pull address references for cache assertEquals( l.size(), 2 ); assertTrue( l.contains(p) && l.contains(p2) ); s.clear(); l = s.createQuery("from Person p order by p.name").list(); //get address references by sequential selects assertEquals( l.size(), 2 ); assertNull( ( (Person) l.get(0) ).getAddress() ); assertNotNull( ( (Person) l.get(1) ).getAddress() ); s.clear(); l = s.createQuery("from Person p left join fetch p.address a order by a.country").list(); //get em by outer join assertEquals( l.size(), 2 ); if ( ( (Person) l.get(0) ).getName().equals("Max") ) { assertNull( ( (Person) l.get(0) ).getAddress() ); assertNotNull( ( (Person) l.get(1) ).getAddress() ); } else { assertNull( ( (Person) l.get(1) ).getAddress() ); assertNotNull( ( (Person) l.get(0) ).getAddress() ); } s.clear(); l = s.createQuery("from Person p left join p.accounts").list(); for ( int i=0; i<2; i++ ) { Object[] row = (Object[]) l.get(i); Person px = (Person) row[0]; Set accounts = px.getAccounts(); assertFalse( Hibernate.isInitialized(accounts) ); assertTrue( px.getAccounts().size()>0 || row[1]==null ); } s.clear(); l = s.createQuery("from Person p left join fetch p.accounts a order by p.name").list(); Person p0 = (Person) l.get(0); assertTrue( Hibernate.isInitialized( p0.getAccounts() ) ); assertEquals( p0.getAccounts().size(), 1 ); assertSame( ( (Account) p0.getAccounts().iterator().next() ).getUser(), p0 ); Person p1 = (Person) l.get(1); assertTrue( Hibernate.isInitialized( p1.getAccounts() ) ); assertEquals( p1.getAccounts().size(), 0 ); s.clear(); l = s.createQuery("from Account a join fetch a.user").list(); s.clear(); l = s.createQuery("from Person p left join fetch p.address").list(); s.clear(); s.createQuery( "delete Address" ).executeUpdate(); s.createQuery( "delete Account" ).executeUpdate(); s.createQuery( "delete Person" ).executeUpdate(); t.commit(); s.close();
Session s = openSession(); Transaction t = s.beginTransaction(); Person p = new Person(); p.setName("Steve"); p.setUserId("steve"); Address a = new Address(); a.setAddress("Texas"); a.setCountry("USA"); p.setAddress(a); a.setPerson(p); s.save(p); Person p2 = new Person(); p2.setName("Max"); p2.setUserId("max"); s.save(p2); Account act = new Account(); act.setType('c'); act.setUser(p2); p2.getAccounts().add(act); s.save(act); s.flush(); s.clear(); p = (Person) s.get( Person.class, p.getId() ); //get address reference by outer join p2 = (Person) s.get( Person.class, p2.getId() ); //get null address reference by outer join assertNull( p2.getAddress() ); assertNotNull( p.getAddress() ); List l = s.createQuery("from Person").list(); //pull address references for cache assertEquals( l.size(), 2 ); assertTrue( l.contains(p) && l.contains(p2) ); s.clear(); l = s.createQuery("from Person p order by p.name").list(); //get address references by sequential selects assertEquals( l.size(), 2 ); assertNull( ( (Person) l.get(0) ).getAddress() ); assertNotNull( ( (Person) l.get(1) ).getAddress() ); s.clear(); l = s.createQuery("from Person p left join fetch p.address a order by a.country").list(); //get em by outer join assertEquals( l.size(), 2 ); if ( ( (Person) l.get(0) ).getName().equals("Max") ) { assertNull( ( (Person) l.get(0) ).getAddress() ); assertNotNull( ( (Person) l.get(1) ).getAddress() ); } else { assertNull( ( (Person) l.get(1) ).getAddress() ); assertNotNull( ( (Person) l.get(0) ).getAddress() ); } s.clear(); l = s.createQuery("from Person p left join p.accounts a").list(); for ( int i=0; i<2; i++ ) { Object[] row = (Object[]) l.get(i); Person px = (Person) row[0]; assertFalse( Hibernate.isInitialized( px.getAccounts() ) ); assertTrue( px.getAccounts().size()>0 || row[1]==null ); } s.clear(); l = s.createQuery("from Person p left join fetch p.accounts a order by p.name").list(); Person p0 = (Person) l.get(0); assertTrue( Hibernate.isInitialized( p0.getAccounts() ) ); assertEquals( p0.getAccounts().size(), 1 ); assertSame( ( (Account) p0.getAccounts().iterator().next() ).getUser(), p0 ); Person p1 = (Person) l.get(1); assertTrue( Hibernate.isInitialized( p1.getAccounts() ) ); assertEquals( p1.getAccounts().size(), 0 ); s.clear(); Account acc = (Account) s.createQuery("from Account a left join fetch a.user").uniqueResult(); assertTrue( Hibernate.isInitialized(acc.getUser()) ); assertNotNull(acc.getUser()); assertTrue( acc.getUser().getAccounts().contains(acc) ); s.createQuery("delete from Address").executeUpdate(); s.createQuery("delete from Account").executeUpdate(); // to not break constraint violation between Person and Account s.createQuery("delete from Person").executeUpdate(); t.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/cuk/CompositePropertyRefTest.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/propertyref/basic/PropertyRefTest.java
Method name: void testOneToOnePropertyRef() Method name: void testOneToOnePropertyRef()
Number of AST nodes: 69 Number of AST nodes: 68
1
Session s = openSession();
1
Session s = openSession();
2
		Transaction t = s.beginTransaction();
2
		Transaction t = s.beginTransaction();
3
		Person p = new Person();
3
		Person p = new Person();
4
		p.setName("Steve");
4
		p.setName("Steve");
5
		p.setUserId("steve");
5
		p.setUserId("steve");
6
		Address a = new Address();
6
		Address a = new Address();
7
		a.setAddress("Texas");
7
		a.setAddress("Texas");
8
		a.setCountry("USA");
8
		a.setCountry("USA");
9
		p.setAddress(a);
9
		p.setAddress(a);
10
		a.setPerson(p);
10
		a.setPerson(p);
11
		s.save(p);
11
		s.save(p);
12
		Person p2 = new Person();
12
		Person p2 = new Person();
13
		p2.setName("Max");
13
		p2.setName("Max");
14
		p2.setUserId("max");
14
		p2.setUserId("max");
15
		s.save(p2);
15
		s.save(p2);
16
		Account act = new Account();
16
		Account act = new Account();
17
		act.setType('c');
17
		act.setType('c');
18
		act.setUser(p2);
18
		act.setUser(p2);
19
		p2.getAccounts().add(act);
19
		p2.getAccounts().add(act);
20
		s.save(act);
20
		s.save(act);
21
		s.flush();
21
		s.flush();
22
		s.clear();
22
		s.clear();
23
		
23
		
24
		p = (Person) s.get( Person.class, p.getId() ); //get address reference by outer join
24
		p = (Person) s.get( Person.class, p.getId() ); //get address reference by outer join
25
		p2 = (Person) s.get( Person.class, p2.getId() ); //get null address reference by outer join
25
		p2 = (Person) s.get( Person.class, p2.getId() ); //get null address reference by outer join
26
		assertNull( p2.getAddress() );
26
		assertNull( p2.getAddress() );
27
		assertNotNull( p.getAddress() );
27
		assertNotNull( p.getAddress() );
28
		List l = s.createQuery("from Person").list(); //pull address references for cache
28
		List l = s.createQuery("from Person").list(); //pull address references for cache
29
		assertEquals( l.size(), 2 );
29
		assertEquals( l.size(), 2 );
30
		assertTrue( l.contains(p) && l.contains(p2) );
30
		assertTrue( l.contains(p) && l.contains(p2) );
31
		s.clear();
31
		s.clear();
32
		
32
		
33
		l = s.createQuery("from Person p order by p.name").list(); //get address references by sequential selects
33
		l = s.createQuery("from Person p order by p.name").list(); //get address references by sequential selects
34
		assertEquals( l.size(), 2 );
34
		assertEquals( l.size(), 2 );
35
		assertNull( ( (Person) l.get(0) ).getAddress() );
35
		assertNull( ( (Person) l.get(0) ).getAddress() );
36
		assertNotNull( ( (Person) l.get(1) ).getAddress() );
36
		assertNotNull( ( (Person) l.get(1) ).getAddress() );
37
		s.clear();
37
		s.clear();
38
		
38
		
39
		l = s.createQuery("from Person p left join fetch p.address a order by a.country").list(); //get em by outer join
39
		l = s.createQuery("from Person p left join fetch p.address a order by a.country").list(); //get em by outer join
40
		assertEquals( l.size(), 2 );
40
		assertEquals( l.size(), 2 );
41
		if ( ( (Person) l.get(0) ).getName().equals("Max") ) {
41
		if ( ( (Person) l.get(0) ).getName().equals("Max") ) {
42
			assertNull( ( (Person) l.get(0) ).getAddress() );
42
			assertNull( ( (Person) l.get(0) ).getAddress() );
43
			assertNotNull( ( (Person) l.get(1) ).getAddress() );
43
			assertNotNull( ( (Person) l.get(1) ).getAddress() );
44
		}
44
		}
45
		else {
45
		else {
46
			assertNull( ( (Person) l.get(1) ).getAddress() );
46
			assertNull( ( (Person) l.get(1) ).getAddress() );
47
			assertNotNull( ( (Person) l.get(0) ).getAddress() );
47
			assertNotNull( ( (Person) l.get(0) ).getAddress() );
48
		}
48
		}
49
		s.clear();
49
		s.clear();
50
		
50
		
51
		l = s.createQuery("from Person p left join p.accounts").list();
51
		l = s.createQuery("from Person p left join p.accounts a").list();
52
		for ( int i=0; i<2; i++ ) {
52
		for ( int i=0; i<2; i++ ) {
53
			Object[] row = (Object[]) l.get(i);
53
			Object[] row = (Object[]) l.get(i);
54
			Person px = (Person) row[0];
54
			Person px = (Person) row[0];
55
			Set accounts = px.getAccounts();
55

56
			assertFalse( Hibernate.isInitialized(accounts) );
56
			assertFalse( Hibernate.isInitialized( px.getAccounts() ) );
57
			assertTrue( px.getAccounts().size()>0 || row[1]==null );
57
			assertTrue( px.getAccounts().size()>0 || row[1]==null );
58
		}
58
		}
59
		s.clear();
59
		s.clear();
60

60
		l = s.createQuery("from Person p left join fetch p.accounts a order by p.name").list();
61
		l = s.createQuery("from Person p left join fetch p.accounts a order by p.name").list();
61
		Person p0 = (Person) l.get(0);
62
		Person p0 = (Person) l.get(0);
62
		assertTrue( Hibernate.isInitialized( p0.getAccounts() ) );
63
		assertTrue( Hibernate.isInitialized( p0.getAccounts() ) );
63
		assertEquals( p0.getAccounts().size(), 1 );
64
		assertEquals( p0.getAccounts().size(), 1 );
64
		assertSame( ( (Account) p0.getAccounts().iterator().next() ).getUser(), p0 );
65
		assertSame( ( (Account) p0.getAccounts().iterator().next() ).getUser(), p0 );
65
		Person p1 = (Person) l.get(1);
66
		Person p1 = (Person) l.get(1);
66
		assertTrue( Hibernate.isInitialized( p1.getAccounts() ) );
67
		assertTrue( Hibernate.isInitialized( p1.getAccounts() ) );
67
		assertEquals( p1.getAccounts().size(), 0 );
68
		assertEquals( p1.getAccounts().size(), 0 );
68
		s.clear();
69
		s.clear();
69
		
70
		
70
		l = s.createQuery("from Account a join fetch a.user").list();
71
Account acc = (Account) s.createQuery("from Account a left join fetch a.user").uniqueResult();
71
		
72
		s.clear(
73
);
72
		assertTrue( Hibernate.isInitialized(acc.getUser()) );
74
		
73
		
75
		l = s.createQuery("from Person p left join fetch p.address").list(
74
assertNotNull(acc.getUser());
76
);
75
		assertTrue( acc.getUser().getAccounts().contains(acc) );
77
		
76
		
78
		s.clear();
77

79
		s.createQuery( "delete Address" ).executeUpdate();
78
		s.createQuery("delete from Address").executeUpdate();
80
		s.createQuery( "delete Account" ).executeUpdate();
79
		s.createQuery("delete from Account").executeUpdate(); // to not break constraint violation between Person and Account
81
		s.createQuery( "delete Person" ).executeUpdate();
80
		s.createQuery("delete from Person").executeUpdate();
81
		
82
		t.commit();
82
		t.commit();
83
		s.close();
83
		s.close();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)5.7
Clones locationClones are in different classes having the same super class
Number of node comparisons1605
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements55
    Number of unmapped statements in the first code fragment14
    Number of unmapped statements in the second code fragment13
    Time elapsed for statement mapping (ms)259.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    Session s = openSession();
    1
    Session s = openSession();
    2
    Transaction t = s.beginTransaction();
    2
    Transaction t = s.beginTransaction();
                                                      
    3
    Person p = new Person();
    3
    Person p = new Person();
                                                      
    4
    p.setName("Steve");
    4
    p.setName("Steve");
    4
    p.setName("Steve");
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Person of variable p does not match with type org.hibernate.test.propertyref.basic.Person of variable p
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    4
    p.setName("Steve");
    5
    p.setUserId("steve");
    5
    p.setUserId("steve");
    5
    p.setUserId("steve");
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Person of variable p does not match with type org.hibernate.test.propertyref.basic.Person of variable p
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    5
    p.setUserId("steve");
                                                          
    6
    Address a = new Address();
    6
    Address a = new Address();
                                                          
    7
    a.setAddress("Texas");
    7
    a.setAddress("Texas");
    7
    a.setAddress("Texas");
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Addressorg.hibernate.test.propertyref.basic.AddressVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Address of variable a does not match with type org.hibernate.test.propertyref.basic.Address of variable a
    • Make classes org.hibernate.test.cuk.Address and org.hibernate.test.propertyref.basic.Address extend a common superclass
    7
    a.setAddress("Texas");
    8
    a.setCountry("USA");
    8
    a.setCountry("USA");
    8
    a.setCountry("USA");
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Addressorg.hibernate.test.propertyref.basic.AddressVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Address of variable a does not match with type org.hibernate.test.propertyref.basic.Address of variable a
    • Make classes org.hibernate.test.cuk.Address and org.hibernate.test.propertyref.basic.Address extend a common superclass
    8
    a.setCountry("USA");
    9
    p.setAddress(a);
    9
    p.setAddress(a);
    9
    p.setAddress(a);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Addressorg.hibernate.test.propertyref.basic.AddressVARIABLE_TYPE_MISMATCH
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Address of variable a does not match with type org.hibernate.test.propertyref.basic.Address of variable a
    • Make classes org.hibernate.test.cuk.Address and org.hibernate.test.propertyref.basic.Address extend a common superclass
    Type org.hibernate.test.cuk.Person of variable p does not match with type org.hibernate.test.propertyref.basic.Person of variable p
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    9
    p.setAddress(a);
    10
    a.setPerson(p);
    10
    a.setPerson(p);
    10
    a.setPerson(p);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    org.hibernate.test.cuk.Addressorg.hibernate.test.propertyref.basic.AddressVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Person of variable p does not match with type org.hibernate.test.propertyref.basic.Person of variable p
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    Type org.hibernate.test.cuk.Address of variable a does not match with type org.hibernate.test.propertyref.basic.Address of variable a
    • Make classes org.hibernate.test.cuk.Address and org.hibernate.test.propertyref.basic.Address extend a common superclass
    10
    a.setPerson(p);
    11
    s.save(p);
    11
    s.save(p);
    11
    s.save(p);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Person of variable p does not match with type org.hibernate.test.propertyref.basic.Person of variable p
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    11
    s.save(p);
                                                          
    12
    Person p2 = new Person();
    12
    Person p2 = new Person();
                                                          
    13
    p2.setName("Max");
    13
    p2.setName("Max");
    13
    p2.setName("Max");
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Person of variable p2 does not match with type org.hibernate.test.propertyref.basic.Person of variable p2
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    13
    p2.setName("Max");
    14
    p2.setUserId("max");
    14
    p2.setUserId("max");
    14
    p2.setUserId("max");
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Person of variable p2 does not match with type org.hibernate.test.propertyref.basic.Person of variable p2
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    14
    p2.setUserId("max");
    15
    s.save(p2);
    15
    s.save(p2);
    15
    s.save(p2);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Person of variable p2 does not match with type org.hibernate.test.propertyref.basic.Person of variable p2
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    15
    s.save(p2);
                                                                
    16
    Account act = new Account();
    16
    Account act = new Account();
                                                                
    17
    act.setType('c');
    17
    act.setType('c');
    17
    act.setType('c');
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Accountorg.hibernate.test.propertyref.basic.AccountVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Account of variable act does not match with type org.hibernate.test.propertyref.basic.Account of variable act
    • Make classes org.hibernate.test.cuk.Account and org.hibernate.test.propertyref.basic.Account extend a common superclass
    17
    act.setType('c');
    18
    act.setUser(p2);
    18
    act.setUser(p2);
    18
    act.setUser(p2);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    org.hibernate.test.cuk.Accountorg.hibernate.test.propertyref.basic.AccountVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Person of variable p2 does not match with type org.hibernate.test.propertyref.basic.Person of variable p2
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    Type org.hibernate.test.cuk.Account of variable act does not match with type org.hibernate.test.propertyref.basic.Account of variable act
    • Make classes org.hibernate.test.cuk.Account and org.hibernate.test.propertyref.basic.Account extend a common superclass
    18
    act.setUser(p2);
    19
    p2.getAccounts().add(act);
    19
    p2.getAccounts().add(act);
    19
    p2.getAccounts().add(act);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Accountorg.hibernate.test.propertyref.basic.AccountVARIABLE_TYPE_MISMATCH
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Account of variable act does not match with type org.hibernate.test.propertyref.basic.Account of variable act
    • Make classes org.hibernate.test.cuk.Account and org.hibernate.test.propertyref.basic.Account extend a common superclass
    Type org.hibernate.test.cuk.Person of variable p2 does not match with type org.hibernate.test.propertyref.basic.Person of variable p2
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    19
    p2.getAccounts().add(act);
    20
    s.save(act);
    20
    s.save(act);
    20
    s.save(act);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Accountorg.hibernate.test.propertyref.basic.AccountVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Account of variable act does not match with type org.hibernate.test.propertyref.basic.Account of variable act
    • Make classes org.hibernate.test.cuk.Account and org.hibernate.test.propertyref.basic.Account extend a common superclass
    20
    s.save(act);
    21
    s.flush();
    21
    s.flush();
    22
    s.clear();
    22
    s.clear();
                                                                                            
    23
    p = (Person)s.get(Person.class, p.getId());
    Preondition Violations
    Unmatched statement p=(Person)s.get(Person.class,p.getId()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    23
    p = (Person)s.get(Person.class, p.getId());
    23
    p = (Person)s.get(Person.class, p.getId());
    23
    p = (Person)s.get(Person.class, p.getId());
    Preondition Violations
    Unmatched statement p=(Person)s.get(Person.class,p.getId()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                            
                                                                                                
    24
    p2 = (Person)s.get(Person.class, p2.getId());
    Preondition Violations
    Unmatched statement p2=(Person)s.get(Person.class,p2.getId()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    24
    p2 = (Person)s.get(Person.class, p2.getId());
    24
    p2 = (Person)s.get(Person.class, p2.getId());
    24
    p2 = (Person)s.get(Person.class, p2.getId());
    Preondition Violations
    Unmatched statement p2=(Person)s.get(Person.class,p2.getId()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                
    25
    assertNull(p2.getAddress());
    25
    assertNull(p2.getAddress());
    25
    assertNull(p2.getAddress());
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Addressorg.hibernate.test.propertyref.basic.AddressVARIABLE_TYPE_MISMATCH
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression p2.getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p2.getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.cuk.Address of variable p2.getAddress() does not match with type org.hibernate.test.propertyref.basic.Address of variable p2.getAddress()
    • Make classes org.hibernate.test.cuk.Address and org.hibernate.test.propertyref.basic.Address extend a common superclass
    Type org.hibernate.test.cuk.Person of variable p2 does not match with type org.hibernate.test.propertyref.basic.Person of variable p2
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    25
    assertNull(p2.getAddress());
    26
    assertNotNull(p.getAddress());
    26
    assertNotNull(p.getAddress());
    26
    assertNotNull(p.getAddress());
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Addressorg.hibernate.test.propertyref.basic.AddressVARIABLE_TYPE_MISMATCH
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression p.getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.cuk.Address of variable p.getAddress() does not match with type org.hibernate.test.propertyref.basic.Address of variable p.getAddress()
    • Make classes org.hibernate.test.cuk.Address and org.hibernate.test.propertyref.basic.Address extend a common superclass
    Type org.hibernate.test.cuk.Person of variable p does not match with type org.hibernate.test.propertyref.basic.Person of variable p
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    26
    assertNotNull(p.getAddress());
    27
    List l = s.createQuery("from Person").list();
    27
    List l = s.createQuery("from Person").list();
    28
    assertEquals(l.size(), 2);
    28
    assertEquals(l.size(), 2);
    29
    assertTrue(l.contains(p) && l.contains(p2));
    29
    assertTrue(l.contains(p) && l.contains(p2));
    29
    assertTrue(l.contains(p) && l.contains(p2));
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Person of variable p does not match with type org.hibernate.test.propertyref.basic.Person of variable p
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    Type org.hibernate.test.cuk.Person of variable p2 does not match with type org.hibernate.test.propertyref.basic.Person of variable p2
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    29
    assertTrue(l.contains(p) && l.contains(p2));
    30
    s.clear();
    30
    s.clear();
    31
    l = s.createQuery("from Person p order by p.name").list();
    31
    l = s.createQuery("from Person p order by p.name").list();
    32
    assertEquals(l.size(), 2);
    32
    assertEquals(l.size(), 2);
    33
    assertNull(((Person)l.get(0)).getAddress());
    33
    assertNull(((Person)l.get(0)).getAddress());
    33
    assertNull(((Person)l.get(0)).getAddress());
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Addressorg.hibernate.test.propertyref.basic.AddressVARIABLE_TYPE_MISMATCH
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression ((Person)l.get(0)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ((Person)l.get(0)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.cuk.Address of variable ((Person)l.get(0)).getAddress() does not match with type org.hibernate.test.propertyref.basic.Address of variable ((Person)l.get(0)).getAddress()
    • Make classes org.hibernate.test.cuk.Address and org.hibernate.test.propertyref.basic.Address extend a common superclass
    Expression (Person)l.get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (Person)l.get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.cuk.Person does not match with type org.hibernate.test.propertyref.basic.Person
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    33
    assertNull(((Person)l.get(0)).getAddress());
    34
    assertNotNull(((Person)l.get(1)).getAddress());
    34
    assertNotNull(((Person)l.get(1)).getAddress());
    34
    assertNotNull(((Person)l.get(1)).getAddress());
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Addressorg.hibernate.test.propertyref.basic.AddressVARIABLE_TYPE_MISMATCH
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression ((Person)l.get(1)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ((Person)l.get(1)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.cuk.Address of variable ((Person)l.get(1)).getAddress() does not match with type org.hibernate.test.propertyref.basic.Address of variable ((Person)l.get(1)).getAddress()
    • Make classes org.hibernate.test.cuk.Address and org.hibernate.test.propertyref.basic.Address extend a common superclass
    Expression (Person)l.get(1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (Person)l.get(1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.cuk.Person does not match with type org.hibernate.test.propertyref.basic.Person
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    34
    assertNotNull(((Person)l.get(1)).getAddress());
    35
    s.clear();
    35
    s.clear();
    36
    l = s.createQuery("from Person p left join fetch p.address a order by a.country").list();
    36
    l = s.createQuery("from Person p left join fetch p.address a order by a.country").list();
    37
    assertEquals(l.size(), 2);
    37
    assertEquals(l.size(), 2);
    38
    if (((Person)l.get(0)).getName().equals("Max"))
    38
    if (((Person)l.get(0)).getName().equals("Max"))
    38
    if (((Person)l.get(0)).getName().equals("Max"))
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression (Person)l.get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (Person)l.get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.cuk.Person does not match with type org.hibernate.test.propertyref.basic.Person
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    38
    if (((Person)l.get(0)).getName().equals("Max"))
    39
    assertNull(((Person)l.get(0)).getAddress());
    39
    assertNull(((Person)l.get(0)).getAddress());
    39
    assertNull(((Person)l.get(0)).getAddress());
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Addressorg.hibernate.test.propertyref.basic.AddressVARIABLE_TYPE_MISMATCH
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression ((Person)l.get(0)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ((Person)l.get(0)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.cuk.Address of variable ((Person)l.get(0)).getAddress() does not match with type org.hibernate.test.propertyref.basic.Address of variable ((Person)l.get(0)).getAddress()
    • Make classes org.hibernate.test.cuk.Address and org.hibernate.test.propertyref.basic.Address extend a common superclass
    Expression (Person)l.get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (Person)l.get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.cuk.Person does not match with type org.hibernate.test.propertyref.basic.Person
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    39
    assertNull(((Person)l.get(0)).getAddress());
    40
    assertNotNull(((Person)l.get(1)).getAddress());
    40
    assertNotNull(((Person)l.get(1)).getAddress());
    40
    assertNotNull(((Person)l.get(1)).getAddress());
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Addressorg.hibernate.test.propertyref.basic.AddressVARIABLE_TYPE_MISMATCH
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression ((Person)l.get(1)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ((Person)l.get(1)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.cuk.Address of variable ((Person)l.get(1)).getAddress() does not match with type org.hibernate.test.propertyref.basic.Address of variable ((Person)l.get(1)).getAddress()
    • Make classes org.hibernate.test.cuk.Address and org.hibernate.test.propertyref.basic.Address extend a common superclass
    Expression (Person)l.get(1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (Person)l.get(1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.cuk.Person does not match with type org.hibernate.test.propertyref.basic.Person
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    40
    assertNotNull(((Person)l.get(1)).getAddress());
    else
    else
    41
    assertNull(((Person)l.get(1)).getAddress());
    41
    assertNull(((Person)l.get(1)).getAddress());
    41
    assertNull(((Person)l.get(1)).getAddress());
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Addressorg.hibernate.test.propertyref.basic.AddressVARIABLE_TYPE_MISMATCH
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression ((Person)l.get(1)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ((Person)l.get(1)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.cuk.Address of variable ((Person)l.get(1)).getAddress() does not match with type org.hibernate.test.propertyref.basic.Address of variable ((Person)l.get(1)).getAddress()
    • Make classes org.hibernate.test.cuk.Address and org.hibernate.test.propertyref.basic.Address extend a common superclass
    Expression (Person)l.get(1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (Person)l.get(1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.cuk.Person does not match with type org.hibernate.test.propertyref.basic.Person
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    41
    assertNull(((Person)l.get(1)).getAddress());
    42
    assertNotNull(((Person)l.get(0)).getAddress());
    42
    assertNotNull(((Person)l.get(0)).getAddress());
    42
    assertNotNull(((Person)l.get(0)).getAddress());
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Addressorg.hibernate.test.propertyref.basic.AddressVARIABLE_TYPE_MISMATCH
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression ((Person)l.get(0)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ((Person)l.get(0)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.cuk.Address of variable ((Person)l.get(0)).getAddress() does not match with type org.hibernate.test.propertyref.basic.Address of variable ((Person)l.get(0)).getAddress()
    • Make classes org.hibernate.test.cuk.Address and org.hibernate.test.propertyref.basic.Address extend a common superclass
    Expression (Person)l.get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (Person)l.get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.cuk.Person does not match with type org.hibernate.test.propertyref.basic.Person
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    42
    assertNotNull(((Person)l.get(0)).getAddress());
    43
    s.clear();
    43
    s.clear();
    44
    l = s.createQuery("from Person p left join p.accounts").list();
    44
    l = s.createQuery("from Person p left join p.accounts").list();
    44
    l = s.createQuery("from Person p left join p.accounts a").list();
    Differences
    Expression1Expression2Difference
    "from Person p left join p.accounts""from Person p left join p.accounts a"LITERAL_VALUE_MISMATCH
    44
    l = s.createQuery("from Person p left join p.accounts a").list();
    45
    for (int i = 0; i < 2; i++)
    45
    for (int i = 0; i < 2; i++)
    46
    Object[] row = (Object[])l.get(i);
    46
    Object[] row = (Object[])l.get(i);
                                                              
    47
    Person px = (Person)row[0];
    Preondition Violations
    Unmatched statement Person px=(Person)row[0]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    47
    Person px = (Person)row[0];
    47
    Person px = (Person)row[0];
    47
    Person px = (Person)row[0];
    Preondition Violations
    Unmatched statement Person px=(Person)row[0]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                              
    48
    Set accounts = px.getAccounts();
    48
    Set accounts = px.getAccounts();
    Preondition Violations
    Unmatched statement Set accounts=px.getAccounts(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                        
    49
    assertFalse(Hibernate.isInitialized(accounts));
    49
    assertFalse(Hibernate.isInitialized(accounts));
    48
    assertFalse(Hibernate.isInitialized(px.getAccounts()));
    Differences
    Expression1Expression2Difference
    accountspx.getAccounts()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression accounts cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression px.getAccounts() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    48
    assertFalse(Hibernate.isInitialized(px.getAccounts()));
    50
    assertTrue(px.getAccounts().size() > 0 || row[1] == null);
    50
    assertTrue(px.getAccounts().size() > 0 || row[1] == null);
    49
    assertTrue(px.getAccounts().size() > 0 || row[1] == null);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Person of variable px does not match with type org.hibernate.test.propertyref.basic.Person of variable px
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    49
    assertTrue(px.getAccounts().size() > 0 || row[1] == null);
    51
    s.clear();
    50
    s.clear();
    52
    l = s.createQuery("from Person p left join fetch p.accounts a order by p.name").list();
    51
    l = s.createQuery("from Person p left join fetch p.accounts a order by p.name").list();
                                                                  
    52
    Person p0 = (Person)l.get(0);
    Preondition Violations
    Unmatched statement Person p0=(Person)l.get(0); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    52
    Person p0 = (Person)l.get(0);
    53
    Person p0 = (Person)l.get(0);
    53
    Person p0 = (Person)l.get(0);
    Preondition Violations
    Unmatched statement Person p0=(Person)l.get(0); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                  
    54
    assertTrue(Hibernate.isInitialized(p0.getAccounts()));
    54
    assertTrue(Hibernate.isInitialized(p0.getAccounts()));
    53
    assertTrue(Hibernate.isInitialized(p0.getAccounts()));
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Person of variable p0 does not match with type org.hibernate.test.propertyref.basic.Person of variable p0
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    53
    assertTrue(Hibernate.isInitialized(p0.getAccounts()));
    55
    assertEquals(p0.getAccounts().size(), 1);
    55
    assertEquals(p0.getAccounts().size(), 1);
    54
    assertEquals(p0.getAccounts().size(), 1);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Person of variable p0 does not match with type org.hibernate.test.propertyref.basic.Person of variable p0
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    54
    assertEquals(p0.getAccounts().size(), 1);
    56
    assertSame(((Account)p0.getAccounts().iterator().next()).getUser(), p0);
    56
    assertSame(((Account)p0.getAccounts().iterator().next()).getUser(), p0);
    55
    assertSame(((Account)p0.getAccounts().iterator().next()).getUser(), p0);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    org.hibernate.test.cuk.Accountorg.hibernate.test.propertyref.basic.AccountVARIABLE_TYPE_MISMATCH
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression ((Account)p0.getAccounts().iterator().next()).getUser() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ((Account)p0.getAccounts().iterator().next()).getUser() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.cuk.Person of variable ((Account)p0.getAccounts().iterator().next()).getUser() does not match with type org.hibernate.test.propertyref.basic.Person of variable ((Account)p0.getAccounts().iterator().next()).getUser()
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    Expression (Account)p0.getAccounts().iterator().next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (Account)p0.getAccounts().iterator().next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.cuk.Account does not match with type org.hibernate.test.propertyref.basic.Account
    • Make classes org.hibernate.test.cuk.Account and org.hibernate.test.propertyref.basic.Account extend a common superclass
    Type org.hibernate.test.cuk.Person of variable p0 does not match with type org.hibernate.test.propertyref.basic.Person of variable p0
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    Type org.hibernate.test.cuk.Person of variable p0 does not match with type org.hibernate.test.propertyref.basic.Person of variable p0
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    55
    assertSame(((Account)p0.getAccounts().iterator().next()).getUser(), p0);
                                                                  
    56
    Person p1 = (Person)l.get(1);
    Preondition Violations
    Unmatched statement Person p1=(Person)l.get(1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    56
    Person p1 = (Person)l.get(1);
    57
    Person p1 = (Person)l.get(1);
    57
    Person p1 = (Person)l.get(1);
    Preondition Violations
    Unmatched statement Person p1=(Person)l.get(1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                  
    58
    assertTrue(Hibernate.isInitialized(p1.getAccounts()));
    58
    assertTrue(Hibernate.isInitialized(p1.getAccounts()));
    57
    assertTrue(Hibernate.isInitialized(p1.getAccounts()));
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Person of variable p1 does not match with type org.hibernate.test.propertyref.basic.Person of variable p1
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    57
    assertTrue(Hibernate.isInitialized(p1.getAccounts()));
    59
    assertEquals(p1.getAccounts().size(), 0);
    59
    assertEquals(p1.getAccounts().size(), 0);
    58
    assertEquals(p1.getAccounts().size(), 0);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.cuk.Personorg.hibernate.test.propertyref.basic.PersonVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.cuk.Person of variable p1 does not match with type org.hibernate.test.propertyref.basic.Person of variable p1
    • Make classes org.hibernate.test.cuk.Person and org.hibernate.test.propertyref.basic.Person extend a common superclass
    58
    assertEquals(p1.getAccounts().size(), 0);
    60
    s.clear();
    59
    s.clear();
                                                                                                                                                                                                  
    60
    Account acc = (Account)s.createQuery("from Account a left join fetch a.user").uniqueResult();
    Preondition Violations
    Unmatched statement Account acc=(Account)s.createQuery("from Account a left join fetch a.user").uniqueResult(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    60
    Account acc = (Account)s.createQuery("from Account a left join fetch a.user").uniqueResult();
                                                                                                                  
    61
    assertTrue(Hibernate.isInitialized(acc.getUser()));
    61
    l = s.createQuery("from Account a join fetch a.user").list();
    61
    l = s.createQuery("from Account a join fetch a.user").list();
    Preondition Violations
    Unmatched statement l=s.createQuery("from Account a join fetch a.user").list(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                  
                                                                      
    62
    assertNotNull(acc.getUser());
    62
    s.clear();
    62
    s.clear();
    Preondition Violations
    Unmatched statement s.clear(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                
                                                                                                                        
    63
    assertTrue(acc.getUser().getAccounts().contains(acc));
    63
    l = s.createQuery("from Person p left join fetch p.address").list();
    63
    l = s.createQuery("from Person p left join fetch p.address").list();
    Preondition Violations
    Unmatched statement l=s.createQuery("from Person p left join fetch p.address").list(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                
    64
    s.clear();
    64
    s.clear();
    Preondition Violations
    Unmatched statement s.clear(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                
    65
    s.createQuery("delete Address").executeUpdate();
    65
    s.createQuery("delete Address").executeUpdate();
    64
    s.createQuery("delete from Address").executeUpdate();
    Differences
    Expression1Expression2Difference
    "delete Address""delete from Address"LITERAL_VALUE_MISMATCH
    64
    s.createQuery("delete from Address").executeUpdate();
    66
    s.createQuery("delete Account").executeUpdate();
    66
    s.createQuery("delete Account").executeUpdate();
    65
    s.createQuery("delete from Account").executeUpdate();
    Differences
    Expression1Expression2Difference
    "delete Account""delete from Account"LITERAL_VALUE_MISMATCH
    65
    s.createQuery("delete from Account").executeUpdate();
    67
    s.createQuery("delete Person").executeUpdate();
    67
    s.createQuery("delete Person").executeUpdate();
    66
    s.createQuery("delete from Person").executeUpdate();
    Differences
    Expression1Expression2Difference
    "delete Person""delete from Person"LITERAL_VALUE_MISMATCH
    66
    s.createQuery("delete from Person").executeUpdate();
    68
    t.commit();
    67
    t.commit();
    69
    s.close();
    68
    s.close();
    Precondition Violations (98)
    Row Violation
    1Type org.hibernate.test.cuk.Person of variable p does not match with type org.hibernate.test.propertyref.basic.Person of variable p
    2Type org.hibernate.test.cuk.Person of variable p does not match with type org.hibernate.test.propertyref.basic.Person of variable p
    3Type org.hibernate.test.cuk.Address of variable a does not match with type org.hibernate.test.propertyref.basic.Address of variable a
    4Type org.hibernate.test.cuk.Address of variable a does not match with type org.hibernate.test.propertyref.basic.Address of variable a
    5Type org.hibernate.test.cuk.Address of variable a does not match with type org.hibernate.test.propertyref.basic.Address of variable a
    6Type org.hibernate.test.cuk.Person of variable p does not match with type org.hibernate.test.propertyref.basic.Person of variable p
    7Type org.hibernate.test.cuk.Person of variable p does not match with type org.hibernate.test.propertyref.basic.Person of variable p
    8Type org.hibernate.test.cuk.Address of variable a does not match with type org.hibernate.test.propertyref.basic.Address of variable a
    9Type org.hibernate.test.cuk.Person of variable p does not match with type org.hibernate.test.propertyref.basic.Person of variable p
    10Type org.hibernate.test.cuk.Person of variable p2 does not match with type org.hibernate.test.propertyref.basic.Person of variable p2
    11Type org.hibernate.test.cuk.Person of variable p2 does not match with type org.hibernate.test.propertyref.basic.Person of variable p2
    12Type org.hibernate.test.cuk.Person of variable p2 does not match with type org.hibernate.test.propertyref.basic.Person of variable p2
    13Type org.hibernate.test.cuk.Account of variable act does not match with type org.hibernate.test.propertyref.basic.Account of variable act
    14Type org.hibernate.test.cuk.Person of variable p2 does not match with type org.hibernate.test.propertyref.basic.Person of variable p2
    15Type org.hibernate.test.cuk.Account of variable act does not match with type org.hibernate.test.propertyref.basic.Account of variable act
    16Type org.hibernate.test.cuk.Account of variable act does not match with type org.hibernate.test.propertyref.basic.Account of variable act
    17Type org.hibernate.test.cuk.Person of variable p2 does not match with type org.hibernate.test.propertyref.basic.Person of variable p2
    18Type org.hibernate.test.cuk.Account of variable act does not match with type org.hibernate.test.propertyref.basic.Account of variable act
    19Unmatched statement p=(Person)s.get(Person.class,p.getId()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    20Unmatched statement p=(Person)s.get(Person.class,p.getId()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    21Unmatched statement p2=(Person)s.get(Person.class,p2.getId()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    22Unmatched statement p2=(Person)s.get(Person.class,p2.getId()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    23Expression p2.getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24Expression p2.getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25Type org.hibernate.test.cuk.Address of variable p2.getAddress() does not match with type org.hibernate.test.propertyref.basic.Address of variable p2.getAddress()
    26Type org.hibernate.test.cuk.Person of variable p2 does not match with type org.hibernate.test.propertyref.basic.Person of variable p2
    27Expression p.getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    28Expression p.getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    29Type org.hibernate.test.cuk.Address of variable p.getAddress() does not match with type org.hibernate.test.propertyref.basic.Address of variable p.getAddress()
    30Type org.hibernate.test.cuk.Person of variable p does not match with type org.hibernate.test.propertyref.basic.Person of variable p
    31Type org.hibernate.test.cuk.Person of variable p does not match with type org.hibernate.test.propertyref.basic.Person of variable p
    32Type org.hibernate.test.cuk.Person of variable p2 does not match with type org.hibernate.test.propertyref.basic.Person of variable p2
    33Expression ((Person)l.get(0)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    34Expression ((Person)l.get(0)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    35Type org.hibernate.test.cuk.Address of variable ((Person)l.get(0)).getAddress() does not match with type org.hibernate.test.propertyref.basic.Address of variable ((Person)l.get(0)).getAddress()
    36Expression (Person)l.get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    37Expression (Person)l.get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    38Type org.hibernate.test.cuk.Person does not match with type org.hibernate.test.propertyref.basic.Person
    39Expression ((Person)l.get(1)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    40Expression ((Person)l.get(1)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    41Type org.hibernate.test.cuk.Address of variable ((Person)l.get(1)).getAddress() does not match with type org.hibernate.test.propertyref.basic.Address of variable ((Person)l.get(1)).getAddress()
    42Expression (Person)l.get(1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    43Expression (Person)l.get(1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    44Type org.hibernate.test.cuk.Person does not match with type org.hibernate.test.propertyref.basic.Person
    45Expression (Person)l.get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    46Expression (Person)l.get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    47Type org.hibernate.test.cuk.Person does not match with type org.hibernate.test.propertyref.basic.Person
    48Expression ((Person)l.get(0)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    49Expression ((Person)l.get(0)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    50Type org.hibernate.test.cuk.Address of variable ((Person)l.get(0)).getAddress() does not match with type org.hibernate.test.propertyref.basic.Address of variable ((Person)l.get(0)).getAddress()
    51Expression (Person)l.get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    52Expression (Person)l.get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    53Type org.hibernate.test.cuk.Person does not match with type org.hibernate.test.propertyref.basic.Person
    54Expression ((Person)l.get(1)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    55Expression ((Person)l.get(1)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    56Type org.hibernate.test.cuk.Address of variable ((Person)l.get(1)).getAddress() does not match with type org.hibernate.test.propertyref.basic.Address of variable ((Person)l.get(1)).getAddress()
    57Expression (Person)l.get(1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    58Expression (Person)l.get(1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    59Type org.hibernate.test.cuk.Person does not match with type org.hibernate.test.propertyref.basic.Person
    60Expression ((Person)l.get(1)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    61Expression ((Person)l.get(1)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    62Type org.hibernate.test.cuk.Address of variable ((Person)l.get(1)).getAddress() does not match with type org.hibernate.test.propertyref.basic.Address of variable ((Person)l.get(1)).getAddress()
    63Expression (Person)l.get(1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    64Expression (Person)l.get(1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    65Type org.hibernate.test.cuk.Person does not match with type org.hibernate.test.propertyref.basic.Person
    66Expression ((Person)l.get(0)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    67Expression ((Person)l.get(0)).getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    68Type org.hibernate.test.cuk.Address of variable ((Person)l.get(0)).getAddress() does not match with type org.hibernate.test.propertyref.basic.Address of variable ((Person)l.get(0)).getAddress()
    69Expression (Person)l.get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    70Expression (Person)l.get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    71Type org.hibernate.test.cuk.Person does not match with type org.hibernate.test.propertyref.basic.Person
    72Unmatched statement Person px=(Person)row[0]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    73Unmatched statement Person px=(Person)row[0]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    74Unmatched statement Set accounts=px.getAccounts(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    75Expression accounts cannot be parameterized, because it has dependencies to/from statements that will be extracted
    76Expression px.getAccounts() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    77Type org.hibernate.test.cuk.Person of variable px does not match with type org.hibernate.test.propertyref.basic.Person of variable px
    78Unmatched statement Person p0=(Person)l.get(0); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    79Unmatched statement Person p0=(Person)l.get(0); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    80Type org.hibernate.test.cuk.Person of variable p0 does not match with type org.hibernate.test.propertyref.basic.Person of variable p0
    81Type org.hibernate.test.cuk.Person of variable p0 does not match with type org.hibernate.test.propertyref.basic.Person of variable p0
    82Expression ((Account)p0.getAccounts().iterator().next()).getUser() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    83Expression ((Account)p0.getAccounts().iterator().next()).getUser() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    84Type org.hibernate.test.cuk.Person of variable ((Account)p0.getAccounts().iterator().next()).getUser() does not match with type org.hibernate.test.propertyref.basic.Person of variable ((Account)p0.getAccounts().iterator().next()).getUser()
    85Expression (Account)p0.getAccounts().iterator().next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    86Expression (Account)p0.getAccounts().iterator().next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    87Type org.hibernate.test.cuk.Account does not match with type org.hibernate.test.propertyref.basic.Account
    88Type org.hibernate.test.cuk.Person of variable p0 does not match with type org.hibernate.test.propertyref.basic.Person of variable p0
    89Type org.hibernate.test.cuk.Person of variable p0 does not match with type org.hibernate.test.propertyref.basic.Person of variable p0
    90Unmatched statement Person p1=(Person)l.get(1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    91Unmatched statement Person p1=(Person)l.get(1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    92Type org.hibernate.test.cuk.Person of variable p1 does not match with type org.hibernate.test.propertyref.basic.Person of variable p1
    93Type org.hibernate.test.cuk.Person of variable p1 does not match with type org.hibernate.test.propertyref.basic.Person of variable p1
    94Unmatched statement Account acc=(Account)s.createQuery("from Account a left join fetch a.user").uniqueResult(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    95Unmatched statement l=s.createQuery("from Account a join fetch a.user").list(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    96Unmatched statement s.clear(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    97Unmatched statement l=s.createQuery("from Person p left join fetch p.address").list(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    98Unmatched statement s.clear(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted