HHH-8276 fixing FooBarTest.testRefresh

This commit is contained in:
Strong Liu 2013-08-15 18:15:18 +08:00 committed by Steve Ebersole
parent aaadcd74ee
commit 712fb95b8a
2 changed files with 5 additions and 5 deletions

View File

@ -127,7 +127,7 @@ public class LegacyBatchingEntityLoaderBuilder extends AbstractBatchingEntityLoa
return getObjectFromList( results, id, session );
}
}
return ( loaders[batchSizes.length-1] ).load( id, optionalObject, session );
return ( loaders[batchSizes.length-1] ).load( id, optionalObject, session, lockOptions );
}
}

View File

@ -4311,11 +4311,11 @@ public class FooBarTest extends LegacyTestCase {
}
);
s.refresh(foo);
assertTrue( foo.getLong().longValue() == -3l );
assertTrue( s.getCurrentLockMode(foo)==LockMode.READ );
assertEquals( Long.valueOf( -3l ), foo.getLong() );
assertEquals( LockMode.READ, s.getCurrentLockMode(foo) );
s.refresh(foo, LockMode.UPGRADE);
if ( getDialect().supportsOuterJoinForUpdate() ) {
assertTrue( s.getCurrentLockMode(foo)==LockMode.UPGRADE );
assertEquals( LockMode.UPGRADE, s.getCurrentLockMode(foo) );
}
s.delete(foo);
s.getTransaction().commit();
@ -4329,7 +4329,7 @@ public class FooBarTest extends LegacyTestCase {
FooProxy foo = new Foo();
s.save(foo);
assertTrue( "autoflush create", s.createQuery( "from Foo foo" ).list().size()==1 );
foo.setChar( new Character('X') );
foo.setChar( 'X' );
assertTrue( "autoflush update", s.createQuery( "from Foo foo where foo.char='X'" ).list().size()==1 );
txn.commit();
s.close();