|
Actually I don't think is possible to inspect the entity to determine if any fields are not loaded, there isn't enough information available. In which case if the FieldInterceptor is null then all we can say is perhaps there are some uninitialised lazy fields, which seems like a runtime error as the entity has not been properly initialised because as Nicolas said in the bug report PojoEntityTuplizer#afterInitialize is not called before the call to hasUninitializedLazyProperties. If the hasUninitializedLazyProperties threw a runtime exception if FieldInterceptor is null then that would stop the code proceeding with broken data which would be preferable to getting a potentially inaccurate response of true.
The pull request which was rejected https://github.com/hibernate/hibernate-orm/pull/870/files seems to work for me (in my limited testing).
|