diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/id/IdClassManyToOneCascadeTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/id/IdClassManyToOneCascadeTest.java index 26a19e176f..a6499b2456 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/id/IdClassManyToOneCascadeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/id/IdClassManyToOneCascadeTest.java @@ -16,7 +16,6 @@ import jakarta.persistence.ManyToOne; import org.hibernate.orm.test.jpa.BaseEntityManagerFunctionalTestCase; -import org.hibernate.testing.FailureExpected; import org.hibernate.testing.TestForIssue; import org.junit.Test; @@ -38,7 +37,6 @@ public class IdClassManyToOneCascadeTest extends BaseEntityManagerFunctionalTest } @Test - @FailureExpected( jiraKey = "HHH-12251") public void testMergeCascadesToManyToOne() { doInJPA( this::entityManagerFactory, entityManager -> { @@ -49,9 +47,9 @@ public class IdClassManyToOneCascadeTest extends BaseEntityManagerFunctionalTest someEntity.setId( 23L ); someEntity.setReferencedEntity( referencedEntity ); - entityManager.merge( someEntity ); + SomeEntity merged = entityManager.merge(someEntity); - assertTrue( entityManager.contains( referencedEntity ) ); + assertTrue( entityManager.contains( merged.getReferencedEntity() ) ); } ); } @@ -80,7 +78,7 @@ public class IdClassManyToOneCascadeTest extends BaseEntityManagerFunctionalTest private long id; @Id - @ManyToOne(cascade = CascadeType.PERSIST) + @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) private ReferencedEntity referencedEntity; public ReferencedEntity getReferencedEntity() {