|
1. I'm not proposing that Hibernate does it in automatic fashion but it may be able to automate some of it. In many application I ended up coding the equivalent of the API proposed above "multiLoad". For example, I receive a request from the UI to get the info of 1000 specific customers. How the UI specified which customer, it's by sending me the ids of the customers. I would like to call "multiLoad" to get the info, and it should be smart enough to figure out the entity still valid, and end-up calling the database in batch, only for the customer not yet in cache and still valid. Of course, option could exist to 'force' a refresh for the customer still in cache, and still valid.
2. In many scenarios, we actually know the exact set of collections that need to be loaded. Be able to tell exactly which one to load is more efficient than the current working feature, which load all similar collections that are lazy.
|