Skip to content

Commit 02a1aa7

Browse files
geoandDavideD
authored andcommitted
Work around lazy eager loading issue in clean DB for OneToOnePrimaryKeyJoinColumnTest
1 parent a2bac94 commit 02a1aa7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

hibernate-reactive-core/src/test/java/org/hibernate/reactive/OneToOnePrimaryKeyJoinColumnTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import java.util.List;
1010
import java.util.Objects;
1111

12+
import org.junit.After;
1213
import org.junit.Test;
1314

1415
import io.vertx.ext.unit.TestContext;
@@ -25,6 +26,13 @@ protected Collection<Class<?>> annotatedEntities() {
2526
return List.of( PersonDetails.class, Person.class );
2627
}
2728

29+
@After
30+
public void cleanDb(TestContext context) {
31+
test( context, getSessionFactory()
32+
.withTransaction( s -> s.createQuery( "delete from PersonDetails" ).executeUpdate()
33+
.thenCompose( v -> s.createQuery( "delete from Person" ).executeUpdate() ) ) );
34+
}
35+
2836
@Test
2937
public void verifyParentKeyIsSet(TestContext context) {
3038
Person person = new Person( "Joshua", 1 );

0 commit comments

Comments
 (0)