-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix IN
/NOT IN
expression handling and support enums when matching on to-many-collections
#11895
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
base: 2.20.x
Are you sure you want to change the base?
Conversation
5f4137b
to
cf240eb
Compare
IN
/NOT IN
criteria/expression handling for to-many-ConnectionsIN
/NOT IN
expression handling and support enums when matching on to-many-collections
IN
/NOT IN
expression handling and support enums when matching on to-many-collectionsIN
/NOT IN
expression handling, support enums when matching on to-many-collections
IN
/NOT IN
expression handling, support enums when matching on to-many-collectionsIN
/NOT IN
expression handling and support enums when matching on to-many-collections
… on to-many-collections This fixes that using a `Criteria` with an `IN` or `NIN` expression on a to-many collection currently leads to an SQL error (doctrine#6173). The `ManyToMany` persister needs to know about the slightly different SQL syntax for `[NOT] IN ()`. In the case of `[NOT] IN` expressions, the value will be an array, which also required me to change (I guess "fix") the parameter type handling. I have pulled the necessary code from the `BasicEntityPersister` and placed it as static helper methods in `PersisterHelper`. This is somewhat inspired by doctrine#11516, which aims at fixing doctrine#11481: By re-using the parameter type handling code, it also fixes using backed enums in `EQ`, `IN` and `NIN` expressions within `Criteria` when `matching()` on one-to-many and many-to-many collections.
cf240eb
to
9bf407f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. More complete than mine.
There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
@derrabus Could you check this PR please ? |
As already mentioned in #11031 (comment) I tried this fix in my code base and it worked fine. Is any help needed in order to get this PR reviewed/merged? |
This fixes that using a
Criteria
with anIN
orNIN
expression on a many-to-many collection currently leads to an SQL error (#6173). TheManyToMany
persister needs to know about the slightly different SQL syntax for[NOT] IN ()
.In the case of
[NOT] IN
expressions, the value will be an array, which also required me to change (fix?) the parameter type handling. I have pulled the necessary code from theBasicEntityPersister
and placed it as static helper methods inPersisterHelper
.This is somewhat inspired by #11516, which aims at fixing #11481: By re-using the parameter type handling code, it also fixes using backed enums in
EQ
,IN
andNIN
expressions withinCriteria
whenmatching()
on one-to-many and many-to-many collections.Fixes #6173, fixes #11031, fixes #11481, closes #11516.