You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just discovered that the issue isn't tied to the use of @ElementCollection and @Embeddable in particular. With the setup as described above, but with the ComplexBean.element relationship expressed through @OneToMany (and ElementBean being an @Entity, not @Embeddable).
Note that the workaround works due to BeanDescriptor.isDeleteByBulk() ... doesn't allow bulk delete due to the persistController that is added by RootBean.preDelete().
Deletes aren't cascaded to embedded beans referenced using
@ElementCollection
Steps to reproduce
The (abstract) data model is:
RootBean
) that is inherited bySimpleBean
andComplexBean
ComplexBean
embeds instances ofElementBean
RootBean
s are referenced through@OneToMany
fromReferencingBean
Instantiating the data structure described above and then deleting a
ReferencingBean
fails as illustrated by the test below:with the following output:
By coincidence I discovered a workaround: adding a @PreDelete hook in the RootBean:
I hope this workaround gives a clue for a solution.
Let me know if I can do anything to help.
The text was updated successfully, but these errors were encountered: