You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by John Huss <jo...@gmail.com> on 2020/10/06 16:49:05 UTC

Re: [jira] [Created] (CAY-2582) Double insert of manyToMany relationship mapped to Set

This change (in 4.1 final) causes any direct modifications to the
java.util.Set mapping the to-many relationship to be ignored, which is a
silently breaking change.

For example, this code:

myEntity.getMyRelationshipMappedAsSet().*add*(newObject);
myEntity.getObjectContext().commitChanges();

will now do nothing to the database. Relationships that use java.util.List
instead already behaved this way, so you could make the argument that this
is more consistent. But it could bite people.

Since these collections can't be directly modified it might make sense to
have the getter return it wrapped in Collections.unmodifiableList(). That
would also be a breaking change, but at least it wouldn't be silent.

Any thoughts?



On Tue, May 21, 2019 at 9:08 AM Nikita Timofeev (JIRA) <ji...@apache.org>
wrote:

> Nikita Timofeev created CAY-2582:
> ------------------------------------
>
>              Summary: Double insert of manyToMany relationship mapped to
> Set
>                  Key: CAY-2582
>                  URL: https://issues.apache.org/jira/browse/CAY-2582
>              Project: Cayenne
>           Issue Type: Bug
>           Components: Core Library
>     Affects Versions: 4.1.B2, 4.0.1
>             Reporter: Nikita Timofeev
>             Assignee: Nikita Timofeev
>              Fix For: 4.0.2, 4.1.B3, 4.2.M1
>
>
>
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v7.6.3#76005)
>