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:
Gail Badner 2015-01-14 15:06:53 -08:00
parent 083e8cf52e
commit d933c78185
3 changed files with 8 additions and 7 deletions

View File

@ -205,9 +205,7 @@ public class CascadeStyles {
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

View File

@ -30,6 +30,7 @@ import javax.persistence.EntityManager;
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 @@ public class DeleteOneToManyOrphansTest extends BaseEntityManagerFunctionalTestC
}
@Test
@TestForIssue( jiraKey = "HHH-9330")
@TestForIssue( jiraKey = "HHH-9568")
@FailureExpected( jiraKey = "HHH-9568" )
public void testOrphanedWhileManaged() {
createData();
@ -100,7 +102,8 @@ public class DeleteOneToManyOrphansTest extends BaseEntityManagerFunctionalTestC
}
@Test
@TestForIssue( jiraKey = "HHH-9330")
@TestForIssue( jiraKey = "HHH-9568")
@FailureExpected( jiraKey = "HHH-9568" )
public void testOrphanedWhileManagedMergeOwner() {
createData();
@ -134,7 +137,8 @@ public class DeleteOneToManyOrphansTest extends BaseEntityManagerFunctionalTestC
}
@Test
@TestForIssue( jiraKey = "HHH-9330")
@TestForIssue( jiraKey = "HHH-9568")
@FailureExpected( jiraKey = "HHH-9568" )
public void testReplacedWhileManaged() {
createData();

View File

@ -49,7 +49,6 @@ public class OneToOneOrphanTest extends BaseEntityManagerFunctionalTestCase {
@Test
@TestForIssue(jiraKey = "HHH-9568")
@FailureExpected(jiraKey = "HHH-9568")
public void testFlushTransientOneToOneNoCascade() throws Exception {
EntityManager em = getOrCreateEntityManager();
em.getTransaction().begin();