mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-16 16:15:06 +00:00
HHH-9568 : EntityManager.flush() does not behave properly with transient one-to-one association and no cascade (reverts HHH-9330)
This commit is contained in:
parent
083e8cf52e
commit
d933c78185
@ -205,9 +205,7 @@ public String toString() {
|
||||
public static final CascadeStyle DELETE_ORPHAN = new BaseCascadeStyle() {
|
||||
@Override
|
||||
public boolean doCascade(CascadingAction action) {
|
||||
return action == CascadingActions.DELETE ||
|
||||
action == CascadingActions.SAVE_UPDATE ||
|
||||
action == CascadingActions.PERSIST_ON_FLUSH;
|
||||
return action == CascadingActions.DELETE || action == CascadingActions.SAVE_UPDATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,6 +30,7 @@
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
|
||||
import org.hibernate.testing.FailureExpected;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@ -67,7 +68,8 @@ private void cleanupData() {
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-9330")
|
||||
@TestForIssue( jiraKey = "HHH-9568")
|
||||
@FailureExpected( jiraKey = "HHH-9568" )
|
||||
public void testOrphanedWhileManaged() {
|
||||
createData();
|
||||
|
||||
@ -100,7 +102,8 @@ public void testOrphanedWhileManaged() {
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-9330")
|
||||
@TestForIssue( jiraKey = "HHH-9568")
|
||||
@FailureExpected( jiraKey = "HHH-9568" )
|
||||
public void testOrphanedWhileManagedMergeOwner() {
|
||||
createData();
|
||||
|
||||
@ -134,7 +137,8 @@ public void testOrphanedWhileManagedMergeOwner() {
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-9330")
|
||||
@TestForIssue( jiraKey = "HHH-9568")
|
||||
@FailureExpected( jiraKey = "HHH-9568" )
|
||||
public void testReplacedWhileManaged() {
|
||||
createData();
|
||||
|
||||
|
@ -49,7 +49,6 @@ public Class[] getAnnotatedClasses() {
|
||||
|
||||
@Test
|
||||
@TestForIssue(jiraKey = "HHH-9568")
|
||||
@FailureExpected(jiraKey = "HHH-9568")
|
||||
public void testFlushTransientOneToOneNoCascade() throws Exception {
|
||||
EntityManager em = getOrCreateEntityManager();
|
||||
em.getTransaction().begin();
|
||||
|
Loading…
x
Reference in New Issue
Block a user