I dug a bit deeper and found something in
Code:
QueryLoader's load(EntityInfo... entityInfos)
, lines 84 and 85.
The method asks the current session to load the given entity by Id, and then a
Code:
Hibernate.isInitialized( element )
call is made. If that is successful, the item is added to the result list being returned.
If I set a breakpoint at that line and manually run that session.load call, it works. So, if the these entities do exist in the system, could the issue be my initial indexing of the entities?
Just to be clear, the ObjectLoader also implements the same interface, Loader, and does
not face the same issue, beacause it calls load, and then attempts to initialize the loaded item, and then adds that item to the result list it returns. Shouldn't the QueryLoader pretty much do the same? In as far as being more forgiving of the value returned by session.load.