Caching does not work properly when hibernate.cache.use_structured_entries is turned on
Description
When hibernate.cache.use_structured_entries is set to true, entities that have superclass are not properly put in cache. Problem is in org.hibernate.sql.results.graph.entity.AbstractEntityInitializer.putInCache , structure from superclass is used for storing cache entry, instead of structure from entity that should be put in cache. This is only a problem when hibernate.cache.use_structured_entries is set to true (see org.hibernate.cache.spi.entry.StructuredCacheEntry.structure vs org.hibernate.cache.spi.entry.UnstructuredCacheEntry.structure). Gradle test case attached.
When
hibernate.cache.use_structured_entries
is set to true, entities that have superclass are not properly put in cache. Problem is inorg.hibernate.sql.results.graph.entity.AbstractEntityInitializer.putInCache
, structure from superclass is used for storing cache entry, instead of structure from entity that should be put in cache. This is only a problem whenhibernate.cache.use_structured_entries
is set to true (seeorg.hibernate.cache.spi.entry.StructuredCacheEntry.structure
vsorg.hibernate.cache.spi.entry.UnstructuredCacheEntry.structure
). Gradle test case attached.