HHH-9629 - l2 cache key constructed wrong for entity with inheritance when fetching lazy property
This commit is contained in:
parent
a51f300253
commit
5514aea2b4
|
@ -205,7 +205,7 @@ public class BatchFetchQueue {
|
|||
final CacheKey key = context.getSession().generateCacheKey(
|
||||
entityKey.getIdentifier(),
|
||||
persister.getIdentifierType(),
|
||||
entityKey.getEntityName()
|
||||
persister.getRootEntityName()
|
||||
);
|
||||
return CacheHelper.fromSharedCache( context.getSession(), key, persister.getCacheAccessStrategy() ) != null;
|
||||
}
|
||||
|
|
|
@ -906,7 +906,7 @@ public abstract class AbstractEntityPersister
|
|||
}
|
||||
|
||||
if ( session.getCacheMode().isGetEnabled() && hasCache() ) {
|
||||
final CacheKey cacheKey = session.generateCacheKey( id, getIdentifierType(), getEntityName() );
|
||||
final CacheKey cacheKey = session.generateCacheKey( id, getIdentifierType(), getRootEntityName() );
|
||||
final Object ce = CacheHelper.fromSharedCache( session, cacheKey, getCacheAccessStrategy() );
|
||||
if ( ce != null ) {
|
||||
final CacheEntry cacheEntry = (CacheEntry) getCacheEntryStructure().destructure( ce, factory );
|
||||
|
|
Loading…
Reference in New Issue