I have a list of identifiers (thousands of items) and I need to load associated objects. Currently I just iterate through the list of identifiers and call session.load() or session.get() for each. A decent number of the objects are caught by the second-level cache, but that still means I'm generating a ridiculous number of selects to populate my list.
Is there a way I can get the same behavior as batch fetching collections, where I don't have "N" selects and I still populate the objects from the second-level cache when possible?
Thanks!
|