I have a Foo domain object that has a 1: n relationship to the domain object panel.
There are two main use cases when I need all foo to meet some criteria. In case A, I care about the bars attached to each foo, in case B, I do not. There are quite a few bars, so just always loading the bars is not very good for case A. In the same way, not loading the bars would eagerly lead to an avalanche n + 1 in case B. Thus, donβt mark reality as @Lazy and not tagging - This is the right choice.
Now, my question is: is it possible to specify the extbase persistence level during the request, be lazy or impatient? If so, how? If not, is there another way in Extbase to avoid the n + 1 problem (i.e. load all the necessary columns and then hope that the caching works when iterates through foos)?
My last resort, of course, would be to load the foos with lazy loading, manually load the bars in the second query, and then manually set the relation.
Any suggestions?
source share