HHH-7304 testcase

This commit is contained in:
Guenther Demetz 2012-05-09 16:41:49 +02:00 committed by Brett Meyer
parent 3aee934d53
commit f58557a567
1 changed files with 17 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.test.jpa.AbstractJPATest;
import org.hibernate.testing.TestForIssue;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@ -37,7 +38,7 @@ import static org.junit.Assert.assertTrue;
public class MutableNaturalIdTest extends AbstractJPATest {
@Override
protected Class<?>[] getAnnotatedClasses() {
return new Class[] { Group.class };
return new Class[] { Group.class, ClassWithIdentityColumn.class };
}
@Test
@ -68,4 +69,19 @@ public class MutableNaturalIdTest extends AbstractJPATest {
s.getTransaction().commit();
s.close();
}
@Test
@TestForIssue( jiraKey = "HHH-7304")
public void testInLineSynchWithIdentityColumn() {
Session s = openSession();
s.beginTransaction();
ClassWithIdentityColumn e = new ClassWithIdentityColumn();
e.setName("Dampf");
s.save(e);
e.setName("Klein");
assertNotNull(session.bySimpleNaturalId(ClassWithIdentityColumn.class).load("Klein"));
session.getTransaction().rollback();
session.close();
}
}