When loading multiple entities via:
{code} List<SomeClass> list = session.byMultipleIds(SomeClass.class).multiLoad(ids); {code}
the resulting list may have unexpected properties:
# If the fetch for {{SomeClass}} contains left outer joins, some instances may be contained multiple times in the resulting list. # Both {{ids}} and the returned {{List<>}} are _ordered_ collections. The principle of least surprise dictates, that the both collections have the _same_ order. In pseudo-code: {{list.get(j).getId().equals(ids.get(j))}} should be {{true}} for any {{j}}. Unless of course a different behavior is documented (it's not, as far as I can tell) # If an entity for a given id cannot be found, I expect a {{null}} in the returned list at the index of that id. That's not the case.
It would be nice, if either these failures got fixed or the documentation got adjusted to reflect the behavior.
Thanks.
(this is related to HHH-7572) |
|