| Another approach could be to utilize StandardCacheEntryImpl.disassembledState to calculate StandardCacheEntryImpl.areLazyPropertiesUnfetched. The already existing TypeHelper.disassemble helper method could be modified calculate this on the side thus encapsulating the logic still in one place. The problematic unfetched value given in constructor would become obsolete thus rendering away the problem described in the issue. This would be also an optimization because persister.hasUninitializedLazyProperties( entity ) would not need to be called at this point. |