git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@13949 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Steve Ebersole 2007-08-24 13:24:03 +00:00
parent d2d2c1c13e
commit 6473e4d24e
1 changed files with 20 additions and 1 deletions

View File

@ -2,7 +2,6 @@
package org.hibernate.test.ops;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.hibernate.Hibernate;
import org.hibernate.Session;
@ -83,6 +82,26 @@ public class GetLoadTest extends FunctionalTestCase {
assertFetchCount(0);
}
public void testGetAfterDelete() {
clearCounts();
Session s = openSession();
s.beginTransaction();
Employer emp = new Employer();
s.persist( emp );
s.getTransaction().commit();
s.close();
s = openSession();
s.beginTransaction();
s.delete( emp );
emp = ( Employer ) s.get( Employee.class, emp.getId() );
s.getTransaction().commit();
s.close();
assertNull( "get did not return null after delete", emp );
}
private void clearCounts() {
getSessions().getStatistics().clear();
}