HHH-7304 testcase
This commit is contained in:
parent
3aee934d53
commit
f58557a567
|
@ -27,6 +27,7 @@ import org.junit.Test;
|
||||||
|
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.test.jpa.AbstractJPATest;
|
import org.hibernate.test.jpa.AbstractJPATest;
|
||||||
|
import org.hibernate.testing.TestForIssue;
|
||||||
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
@ -37,7 +38,7 @@ import static org.junit.Assert.assertTrue;
|
||||||
public class MutableNaturalIdTest extends AbstractJPATest {
|
public class MutableNaturalIdTest extends AbstractJPATest {
|
||||||
@Override
|
@Override
|
||||||
protected Class<?>[] getAnnotatedClasses() {
|
protected Class<?>[] getAnnotatedClasses() {
|
||||||
return new Class[] { Group.class };
|
return new Class[] { Group.class, ClassWithIdentityColumn.class };
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -68,4 +69,19 @@ public class MutableNaturalIdTest extends AbstractJPATest {
|
||||||
s.getTransaction().commit();
|
s.getTransaction().commit();
|
||||||
s.close();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue