Actually, there is some different behavior here in regards to Session#get/IdentifierLoadAccess#load versus Session#load/IdentifierLoadAccess#getReference:
- In the Session#load/IdentifierLoadAccess#getReference case the deleted entity is returned.
- In the Session#get/IdentifierLoadAccess#load case the deleted entity is not returned (it is replaced with null).
So we need to decide:
- whether we want to support both cases in MultiIdentifierLoadAccess. I can see the argument for supporting both.
- assuming we want to support both, is that through separate methods? Or as an option? If an option, which is the default?
- assuming we want to support just one, which is the use case we want to support? I'd lean toward agreeing with Myeonghyeon-Lee in that we should not return the entity if it is currently scheduled for deletion - that would be more consistent with the Session#get/IdentifierLoadAccess#load case
|