-
-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support change tracking on inverse side of M:N relations #4564
Labels
enhancement
New feature or request
Milestone
Comments
This was referenced Jul 27, 2023
B4nan
added a commit
that referenced
this issue
Oct 8, 2023
B4nan
added a commit
that referenced
this issue
Oct 8, 2023
B4nan
added a commit
that referenced
this issue
Oct 8, 2023
B4nan
added a commit
that referenced
this issue
Oct 8, 2023
Implements diffing for inverse sides of M:N relations (for SQL drivers). This was previously working only if the items were initialized. ```ts const tag = await em.findOne(BookTag, 1); // tag.books in an inverse side tag.books.add(em.getReference(Book, 123)); await em.flush(); ``` The M:N updates are now also batched. Closes #4564
Closing as implemented in v6 via #4798 |
B4nan
added a commit
that referenced
this issue
Oct 17, 2023
Implements diffing for inverse sides of M:N relations (for SQL drivers). This was previously working only if the items were initialized. ```ts const tag = await em.findOne(BookTag, 1); // tag.books in an inverse side tag.books.add(em.getReference(Book, 123)); await em.flush(); ``` The M:N updates are now also batched. Closes #4564
B4nan
added a commit
that referenced
this issue
Oct 21, 2023
Implements diffing for inverse sides of M:N relations (for SQL drivers). This was previously working only if the items were initialized. ```ts const tag = await em.findOne(BookTag, 1); // tag.books in an inverse side tag.books.add(em.getReference(Book, 123)); await em.flush(); ``` The M:N updates are now also batched. Closes #4564
B4nan
added a commit
that referenced
this issue
Oct 25, 2023
Implements diffing for inverse sides of M:N relations (for SQL drivers). This was previously working only if the items were initialized. ```ts const tag = await em.findOne(BookTag, 1); // tag.books in an inverse side tag.books.add(em.getReference(Book, 123)); await em.flush(); ``` The M:N updates are now also batched. Closes #4564
B4nan
added a commit
that referenced
this issue
Nov 2, 2023
Implements diffing for inverse sides of M:N relations (for SQL drivers). This was previously working only if the items were initialized. ```ts const tag = await em.findOne(BookTag, 1); // tag.books in an inverse side tag.books.add(em.getReference(Book, 123)); await em.flush(); ``` The M:N updates are now also batched. Closes #4564
B4nan
added a commit
that referenced
this issue
Nov 5, 2023
Implements diffing for inverse sides of M:N relations (for SQL drivers). This was previously working only if the items were initialized. ```ts const tag = await em.findOne(BookTag, 1); // tag.books in an inverse side tag.books.add(em.getReference(Book, 123)); await em.flush(); ``` The M:N updates are now also batched. Closes #4564
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Currently, only the owning sides of M:N relations are checked for changes. Working with inverse side works as long as you are adding or removing specific and populated items, but it won't work if you try to add not loaded reference instead. Also calling
removeAll()
on inverse side is not working at all.Describe the solution you'd like
We should probably check both sides of M:N relations, and try to compute the diff respecting both.
Describe alternatives you've considered
If this proves to be too hard, we should at least throw instead of silently ignoring those problematic actions.
Additional context
This has been one of the common pain points since inception.
The text was updated successfully, but these errors were encountered: