FileDocCategorySizeDatePackage
AbstractComponentPropertyRefTest.javaAPI DocHibernate 3.2.51428Tue Dec 12 16:22:26 GMT 2006org.hibernate.test.abstractembeddedcomponents.propertyref

AbstractComponentPropertyRefTest

public class AbstractComponentPropertyRefTest extends org.hibernate.junit.functional.FunctionalTestCase
author
Steve Ebersole

Fields Summary
Constructors Summary
public AbstractComponentPropertyRefTest(String name)

		super( name );
	
Methods Summary
public java.lang.String[]getMappings()

		return new String[] { "abstractembeddedcomponents/propertyref/Mappings.hbm.xml" };
	
public static junit.framework.Testsuite()

		return new FunctionalTestClassTestSuite( AbstractComponentPropertyRefTest.class );
	
public voidtestPropertiesRefCascades()

		Session session = openSession();
		Transaction trans = session.beginTransaction();
		ServerImpl server = new ServerImpl();
		session.save( server );
		AddressImpl address = new AddressImpl();
		server.setAddress( address );
		address.setServer( server );
		session.flush();
		session.createQuery( "from Server s join fetch s.address" ).list();
		trans.commit();
		session.close();

		assertNotNull( server.getId() );
		assertNotNull( address.getId() );

		session = openSession();
		trans = session.beginTransaction();
		session.delete( address );
		session.delete( server );
		trans.commit();
		session.close();