FileDocCategorySizeDatePackage
OptionalOneToOneTest.javaAPI DocHibernate 3.2.51297Mon Jan 22 11:59:20 GMT 2007org.hibernate.test.onetoone.optional

OptionalOneToOneTest

public class OptionalOneToOneTest extends org.hibernate.junit.functional.FunctionalTestCase
author
Gavin King

Fields Summary
Constructors Summary
public OptionalOneToOneTest(String str)

		super(str);
	
Methods Summary
public voidconfigure(org.hibernate.cfg.Configuration cfg)

		cfg.setProperty( Environment.USE_SECOND_LEVEL_CACHE, "false");
		cfg.setProperty(Environment.GENERATE_STATISTICS, "true");
	
public java.lang.String[]getMappings()

		return new String[] { "onetoone/optional/Person.hbm.xml" };
	
public static junit.framework.Testsuite()

		return new FunctionalTestClassTestSuite( OptionalOneToOneTest.class );
	
public voidtestOptionalOneToOneRetrieval()

		Session s = openSession();
		s.beginTransaction();
		Person me = new Person();
		me.name = "Steve";
		s.save( me );
		s.getTransaction().commit();
		s.close();

		s = openSession();
		s.beginTransaction();
		me = ( Person ) s.load( Person.class, me.name );
		assertNull( me.address );
		s.delete( me );
		s.getTransaction().commit();
		s.close();