HHH-9629 Use root entity name for constructing cache key
This commit is contained in:
parent
21f7c44e68
commit
8d6c318797
|
@ -222,7 +222,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;
|
||||
}
|
||||
|
|
|
@ -1235,7 +1235,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