HHH-12146 - Support enabling caching at any level within a mapped hierarchy
This commit is contained in:
parent
58e6235c6b
commit
9f50157a60
|
@ -600,7 +600,7 @@ public class EntityBinder {
|
|||
}
|
||||
}
|
||||
|
||||
cacheConcurrentStrategy = effectiveCacheAnn.usage().name();
|
||||
cacheConcurrentStrategy = resolveCacheConcurrencyStrategy( effectiveCacheAnn.usage() );
|
||||
cacheRegion = effectiveCacheAnn.region();
|
||||
switch ( effectiveCacheAnn.include().toLowerCase( Locale.ROOT ) ) {
|
||||
case "all": {
|
||||
|
@ -674,6 +674,11 @@ public class EntityBinder {
|
|||
}
|
||||
}
|
||||
|
||||
private static String resolveCacheConcurrencyStrategy(CacheConcurrencyStrategy strategy) {
|
||||
final org.hibernate.cache.spi.access.AccessType accessType = strategy.toAccessType();
|
||||
return accessType == null ? null : accessType.getExternalName();
|
||||
}
|
||||
|
||||
private static Cache buildCacheMock(String region, MetadataBuildingContext context) {
|
||||
return new LocalCacheAnnotationStub( region, determineCacheConcurrencyStrategy( context ) );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue