It seems that the fix for https://hibernate.atlassian.net/browse/HHH-15500 was not really satisfactory for some use cases. After digging a bit into this, I found out that NaturalIdCacheKey uses Type#disassemble instead. I think it might have been an error to introduce CacheKeyValueDescriptor and we should instead rely on Type#disassemble in the CacheKeyImplementation as well. We might want to clarify the contract in Type#disassemble a bit though, as one of the implications of such a usage is, that the method must produce objects for which we can use Objects#deepEquals instead of JavaType#areEqual. |