Skip to content

Commit 0121e6c

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

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

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

13+
import org.junit.After;
1314
import org.junit.Test;
1415

1516
import io.vertx.ext.unit.TestContext;
@@ -32,6 +33,15 @@ protected Collection<Class<?>> annotatedEntities() {
3233
return List.of( Book.class, Author.class, SpellBook.class );
3334
}
3435

36+
@After
37+
public void cleanDb(TestContext context) {
38+
test( context, getSessionFactory()
39+
.withTransaction( s -> s.createQuery( "delete from Author" ).executeUpdate()
40+
.thenCompose( v -> s.createQuery( "delete from SpellBook" ).executeUpdate() )
41+
.thenCompose( v -> s.createQuery("delete from Book ").executeUpdate())) );
42+
}
43+
44+
3545
@Test
3646
public void testRootClassViaAssociation(TestContext context) {
3747
final Book book = new Book( 6, "The Boy, The Mole, The Fox and The Horse", new Date());

0 commit comments

Comments
 (0)