# Problem with @ElementCollection and Hibernate 5.4.29.Final

**URL:** https://discourse.hibernate.org/t/problem-with-elementcollection-and-hibernate-5-4-29-final/5251
**Category:** Hibernate ORM
**Created:** [April 7, 2021, 6:35am UTC](https://discourse.hibernate.org/t/problem-with-elementcollection-and-hibernate-5-4-29-final/5251 "2021-04-07T06:35:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![renegrob](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/renegrob/32/1477_2.png) [@renegrob](https://discourse.hibernate.org/u/renegrob)
#### Post date: [April 7, 2021, 6:35am UTC](https://discourse.hibernate.org/t/problem-with-elementcollection-and-hibernate-5-4-29-final/5251/1 "2021-04-07T06:35:36Z")

</div>

Hi all,

I have an `@ElementCollection` which is defined like this:

```java
    @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.

---

<div class="post-metadata">

### Author: ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)
#### Post date: [April 7, 2021, 7:58am UTC](https://discourse.hibernate.org/t/problem-with-elementcollection-and-hibernate-5-4-29-final/5251/2 "2021-04-07T07:58:02Z")

</div>

Please create an issue in the issue tracker([https://hibernate.atlassian.net](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](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.

---

<div class="post-metadata">

### Author: ![renegrob](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/renegrob/32/1477_2.png) [@renegrob](https://discourse.hibernate.org/u/renegrob)
#### Post date: [April 7, 2021, 11:35am UTC](https://discourse.hibernate.org/t/problem-with-elementcollection-and-hibernate-5-4-29-final/5251/4 "2021-04-07T11:35:53Z")

</div>

[https://hibernate.atlassian.net/browse/HHH-14547](https://hibernate.atlassian.net/browse/HHH-14547)
