@ManyToMany with @JoinTable(inverseColumn = ...) and SortedSet may results in data loss

Description

Affects ORM 6.2, but not 5.6, and (I think) not 6.1 either.

With the following model, attempting to remove one entity from the associations may result in the whole association being cleared.

The problem appears to be in the SQL generated to remove an element from the association, which completely ignores one side of the association:

Whereas, when @JoinTable(inverseColumn) is not used, we get:

Removing @JoinTable(inverseColumn = ...), or moving from SortedSet to List, makes the problem disappear.

I will submit a reproducer in the comments.

Activity

Show:

Yoann Rodière January 12, 2023 at 1:05 PM

Here is a reproducer:

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created January 12, 2023 at 12:59 PM
Updated April 5, 2023 at 8:05 AM
Resolved January 24, 2023 at 9:49 AM