Skip to content

Commit

Permalink
HHH-9568 : EntityManager.flush() does not behave properly with transi…
Browse files Browse the repository at this point in the history
…ent one-to-one association and no cascade (reverts HHH-9330)

(cherry picked from commit d933c78)
  • Loading branch information
gbadner committed Jan 14, 2015
1 parent 62bfc27 commit e4715cc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Expand Up @@ -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
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -67,7 +68,8 @@ private void cleanupData() {
}

@Test
@TestForIssue( jiraKey = "HHH-9330")
@TestForIssue( jiraKey = "HHH-9568")
@FailureExpected( jiraKey = "HHH-9568" )
public void testOrphanedWhileManaged() {
createData();

Expand Down Expand Up @@ -100,7 +102,8 @@ public void testOrphanedWhileManaged() {
}

@Test
@TestForIssue( jiraKey = "HHH-9330")
@TestForIssue( jiraKey = "HHH-9568")
@FailureExpected( jiraKey = "HHH-9568" )
public void testOrphanedWhileManagedMergeOwner() {
createData();

Expand Down Expand Up @@ -134,7 +137,8 @@ public void testOrphanedWhileManagedMergeOwner() {
}

@Test
@TestForIssue( jiraKey = "HHH-9330")
@TestForIssue( jiraKey = "HHH-9568")
@FailureExpected( jiraKey = "HHH-9568" )
public void testReplacedWhileManaged() {
createData();

Expand Down
Expand Up @@ -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();
Expand Down

0 comments on commit e4715cc

Please sign in to comment.