Hibernate.isPropertyInitialized( someEntity, "id" ) returns false


After upgrading to ORM 5.5, Hibernate.isPropertyInitialized( someEntity, "id" ) returns false in one of Hibernate Search's integration tests.

Looking at the code of Hibernate.isPropertyInitialized I see this:

In ORM 5.4 I end up in the second if block. In 5.5 I end up in the first one.

I think the return false is wrong, and we should actually only return false if the property is not the ID. The code of EnhancementAsProxyLazinessInterceptor actually confirms my thoughts: there is a special case for the identifier attributes.

For some reason I don't have this bug in 5.4, despite having the same code in Hibernate.isPropertyInitialized. I suppose the reason is something changed in how ORM decides which intereceptor to use, and my test simply does not use a EnhancementAsProxyLazinessInterceptor with ORM 5.4.




Yoann Rodière


Yoann Rodière

Fix versions