|
This is a set of thoughts floating around while working on the subject.
ORM has batch which allows to load proxied entities by batch of n (roughly). We can use that but in the case of a collection being loaded, it's not necessarily the "best solution" as might require multiple several roundtrips of some earlier uninitialized proxies of that type are in the session or if the collection size > n.
A better approach is to know that a given collection is being loaded and as such load the associated entities as one go. But that only address loading entity A and its entities B. For queries or batched loading of a set of As, we could query and return the collection information of As to Bs and then load all Bs of all As in one go.
We should also implement extra lazy collections to be able to add elements to a big collection, get the size of a collection in a cheap way.
|