FileDocCategorySizeDatePackage
TestDirtyCheckExecutable.javaAPI DocHibernate 3.2.51252Tue Dec 12 16:22:26 GMT 2006org.hibernate.test.instrument.cases

TestDirtyCheckExecutable

public class TestDirtyCheckExecutable extends AbstractExecutable
author
Steve Ebersole

Fields Summary
Constructors Summary
Methods Summary
public voidexecute()

		Session s = getFactory().openSession();
		Transaction t = s.beginTransaction();
		Folder pics = new Folder();
		pics.setName("pics");
		Folder docs = new Folder();
		docs.setName("docs");
		s.persist(docs);
		s.persist(pics);
		t.commit();
		s.close();

		s = getFactory().openSession();
		t = s.beginTransaction();
		List list = s.createCriteria(Folder.class).list();
		for ( Iterator iter = list.iterator(); iter.hasNext(); ) {
			Folder f = (Folder) iter.next();
			Assert.assertFalse( f.nameWasread );
		}
		t.commit();
		s.close();

		for ( Iterator iter = list.iterator(); iter.hasNext(); ) {
			Folder f = (Folder) iter.next();
			Assert.assertFalse( f.nameWasread );
		}

		s = getFactory().openSession();
		t = s.beginTransaction();
		s.createQuery("delete from Folder").executeUpdate();
		t.commit();
		s.close();