-
Notifications
You must be signed in to change notification settings - Fork 228
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
Elide incorrectly identifies embedded properties as relationships in RootCollectionFetchQueryBuilder.build() #2684
Comments
Here is a UT that reproduces the issue (to put in RootCollectionFetchQueryBuilderTest.java):
This will throw an InvalidValueException instead of generating a SQL query. I am currently trying to fix the code by myself, I will let you know if I succeed. :) |
LamWizy
pushed a commit
to LamWizy/elide
that referenced
this issue
Jun 24, 2022
…relationships anymore. (yahoo#2684)
I have found a fix and created a pull request for it; since this is my first contribution, please let me know if there's anything wrong with it. |
LamWizy
pushed a commit
to LamWizy/elide
that referenced
this issue
Jun 27, 2022
LamWizy
pushed a commit
to LamWizy/elide
that referenced
this issue
Jun 27, 2022
LamWizy
pushed a commit
to LamWizy/elide
that referenced
this issue
Jul 5, 2022
aklish
added a commit
that referenced
this issue
Jul 13, 2022
#2686) * Fixed query builder so that it does not treat embedded properties as relationships anymore. (#2684) * Removed unused imports. (#2684) * Replaced isRelationship() method with dictionary.isRelation(). (#2684) * Fix style formatting. (#2684) Co-authored-by: Lâm Tran Duy <[email protected]> Co-authored-by: Aaron Klish <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
It should be possible to sort by an embedded property when using paging and filtering at the same time.
Current Behavior
When sorting by an embedded property, the error message "Combination of pagination, sorting over relationship and filtering over toMany relationships unsupported" is returned if paging and filtering is used.
Possible Solution
In RootCollectionFectQueryBuilder.build(), the sortOverRelationship variable is set to true if a Sorting item includes an embedded property, instead of being set to true only if a Sorting item includes relationship properties.
It should be possible to fix it by excluding Sorting items that only includes embedded properties, from the list of Sorting items to test for the sortOverRelationship variable.
Steps to Reproduce (for bugs)
I tried to reproduce the issue by adding a pagination option in the RootCollectionFetchQueryBuilderTest.testRootFetchWithRelationshipSortingFilters() unit test, but it doesn't seem to trigger the incorrect behavior.
Context
I am trying to filter a list of entities, while applying pagination and sorting. I've opened this issue because I'm trying to fix the bug by myself but I haven't had much luck so far, so any help or comment would be appreciated.
Your Environment
The text was updated successfully, but these errors were encountered: