Problem with @ElementCollection and Hibernate 5.4.29.Final

Hi all,

I have an @ElementCollection which is defined like this:

    @ElementCollection
    @JoinTable(name = "PRINCIPAL_ALIAS", joinColumns = @JoinColumn(name = "PRINCIPAL_ID", referencedColumnName = "PRINCIPAL_ID"))
    @MapKeyColumn(name = "QUALIFIER")
    @Column(name = "ALIAS")
    private Map<String, String> aliases = new HashMap<>();

It seems that Hibernate doesn’t delete the referenced rows in the JoinTable anymore before deleting the rows in the entity’s table. Now tests are failing with Caused by: org.hsqldb.HsqlException: integrity constraint violation: foreign key no action; FKNRKMUYFDVBDLGQ0455HTR1AHL table: PRINCIPAL_ALIAS.
It used to work with 5.4.28.5.4.28.Final
The items are deleted one by one, so it isn’t the bulk delete limitation.

Please create an issue in the issue tracker(https://hibernate.atlassian.net) with a test case(https://github.com/hibernate/hibernate-test-case-templates/blob/master/orm/hibernate-orm-5/src/test/java/org/hibernate/bugs/JPAUnitTestCase.java) that reproduces the issue.

https://hibernate.atlassian.net/browse/HHH-14547

1 Like