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. |