FileDocCategorySizeDatePackage
ArrayTest.javaAPI DocHibernate 3.2.51178Tue Dec 12 16:22:26 GMT 2006org.hibernate.test.array

ArrayTest

public class ArrayTest extends org.hibernate.junit.functional.FunctionalTestCase
author
Emmanuel Bernard

Fields Summary
Constructors Summary
public ArrayTest(String x)

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

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

		return new FunctionalTestClassTestSuite( ArrayTest.class );
	
public voidtestArrayJoinFetch()

		Session s;
		Transaction tx;
		s = openSession();
		tx = s.beginTransaction();
		A a = new A();
		B b = new B();
		a.setBs( new B[] {b} );
		s.persist( a );
		tx.commit();
		s.close();

		s = openSession();
		tx = s.beginTransaction();
		a = (A) s.get( A.class, a.getId() );
		assertNotNull( a );
		assertNotNull( a.getBs() );
		assertEquals( a.getBs().length, 1 );
		assertNotNull( a.getBs()[0] );
		
		s.delete(a);
		s.delete(a.getBs()[0]);
		tx.commit();
		s.close();