From 7b788b748dc5b23c36343fcd8d7ce629c73721c1 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Thu, 6 Nov 2025 16:33:39 +0100 Subject: [PATCH] [#2737] Add test for MariaDB, mutation delete query does not delete an entity with joined inheritance --- .../JoinedSubclassInheritanceTest.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/hibernate-reactive-core/src/test/java/org/hibernate/reactive/JoinedSubclassInheritanceTest.java b/hibernate-reactive-core/src/test/java/org/hibernate/reactive/JoinedSubclassInheritanceTest.java index ab64e1925..647573e95 100644 --- a/hibernate-reactive-core/src/test/java/org/hibernate/reactive/JoinedSubclassInheritanceTest.java +++ b/hibernate-reactive-core/src/test/java/org/hibernate/reactive/JoinedSubclassInheritanceTest.java @@ -185,6 +185,29 @@ public void testQueryUpdateWithParameters(VertxTestContext context) { ); } + @Test + public void testHqlDelete(VertxTestContext context) { + final Integer id = 1; + final String title = "Spell Book: A Comprehensive Guide to Magic Spells and Incantations"; + SpellBook spellBook = new SpellBook( id, title, true, new Date() ); + test( context, getMutinySessionFactory().withTransaction( session -> session.persist( spellBook ) ) + .call( () -> getMutinySessionFactory().withTransaction( session -> session + .createMutationQuery( + "delete from SpellBook where id = :id and forbidden = :forbidden and title = :title" ) + .setParameter( "id", id ) + .setParameter( "title", title ) + .setParameter( "forbidden", true ) + .executeUpdate() ) + ) + .call( () -> getMutinySessionFactory().withTransaction( session -> session + .createSelectionQuery( "from SpellBook g where g.id = :id ", SpellBook.class ) + .setParameter( "id", id ) + .getSingleResultOrNull() + .invoke( Assertions::assertNull ) ) + ) + ); + } + @Entity(name="SpellBook") @Table(name = "SpellBookJS") @DiscriminatorValue("S")