-
-
Notifications
You must be signed in to change notification settings - Fork 102
Open
Description
Given:
@Entity
@DiscriminatorValue("S")
public static class SpellBook extends Book {
private boolean forbidden;
}
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public static class Book {
@Id
private Integer id;
private String title;
}the following test fails
@Test
public void testHqlDelete(VertxTestContext context) {
final Integer id = 1;
final String title = "Spell Book: A Comprehensive Guide to Magic Spells and Incantations";
test( context, getMutinySessionFactory().withTransaction( session -> session
.createMutationQuery( "insert into SpellBook (id, title, forbidden) values (:id, :title, :forbidden)" )
.setParameter( "id", id )
.setParameter( "title", title )
.setParameter( "forbidden", true )
.executeUpdate() )
.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 ) )
)
);
}Because the SpellBook is not deleted.
Metadata
Metadata
Assignees
Labels
No labels