What I'm proposing is a -to-many association fetch mode (maybe lazy mode) where only children ids would be fetched when we fetch the collection, rather than whole children entities, as it is the case now.
Why ? Suppose we use a second level cache for children entities, and that we warm this cache up (fill it up) at application start : We will still fetch these children entites each time we fetch a collection of such entites, althought all of them were available in the second level cache, and possibly take time to fetch !
With this fetch mode, we would select the children ids list, and then get the entities one by one, allowing for using the cache. The fetch could also be used to warm collections caches up (these contain lists of ids, if I'm not mistaking...?)
Maybe there is a way to get around this, but I found neither that was satisfactory. The "best" I found is to link the father entity to a collection of "id entities", themselves linked (one-to-one) to the "real", big entity. But this is not handy.
So I think I'll create a JIRA, unless somebody points the solution to me, or tells me a JIRA issue already exists...?
Thanks for your attention ! Feel free to ask for any explanation.
|