feat: EXPOSED-462 Filtering on entity references - #2472
Open
natri0 wants to merge 5 commits into
Open
Conversation
Now it's possible to additionally filter the child entities on a one-to-many relationship by using a `View` as the left-hand-side parameter for `referrersOn`:
val kids by User.view { Users.age less 18 } referrersOn Users.city
This example was added to SamplesDao to show off the new feature.
FIXME: tried adding eager loading but it seems like there's no way to filter entities based on the Op, so might for now be impossible.
TODO: write tests
TODO: write tests
I don't know how to actually make the caching work there. :( Seems like we'd have to evaluate the custom WHERE clause from the View and filter based on that, but it doens't look like there's any way to evaluate a Op<Boolean>.
Author
|
though I didn't figure out how caching is supposed to work in this case, so if anyone has any thoughts would be thankful. |
|
I would like to know what the current status of this feature is. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary of the change: Adds a way to filter
referrersOn/optionalReferrersOnDetailed description:
View.referrersOnandView.optionalReferrersOn.Referrersto a separate method subclasses can overrideViewReferrersclass representing areferrersOnwith aViewleft-hand side parameter (as opposed toEntityClass)Type of Change
Please mark the relevant options with an "X":
Updates/remove existing public API methods:
Affected databases:
Checklist
Related Issues
EXPOSED-462