/** * @deprecated Use {@link #getQueryResultsCache(String)} instead, but using unqualified name */ @Deprecated default QueryCache getQueryCache(String regionName) throws HibernateException { return getQueryResultsCache( unqualifyRegionName( regionName ) ); }
private CacheRegionStatisticsImpl getQueryRegionStats(String regionName) { return l2CacheStatsMap.computeIfAbsent( regionName, s -> new CacheRegionStatisticsImpl( sessionFactory.getCache().getQueryResultsCache( regionName ).getRegion() ) ); }
@Override public CacheRegionStatisticsImpl getCacheRegionStatistics(String regionName) { if ( sessionFactory == null ) { return null; } if ( ! sessionFactory.getSessionFactoryOptions().isSecondLevelCacheEnabled() ) { return null; } return l2CacheStatsMap.computeIfAbsent( regionName, s -> { Region region = sessionFactory.getCache().getRegion( regionName ); if ( region == null ) { // this is the pre-5.3 behavior. and since this is a pre-5.3 method it should behave consistently // NOTE that this method is deprecated region = sessionFactory.getCache().getQueryResultsCache( regionName ).getRegion(); } return new CacheRegionStatisticsImpl( region ); } ); }
final Type[] resultTypes) { QueryResultsCache queryCache = factory.getCache().getQueryResultsCache( queryParameters.getCacheRegion() );
private CacheRegionStatisticsImpl getQueryRegionStats(String regionName) { return l2CacheStatsMap.computeIfAbsent( regionName, s -> new CacheRegionStatisticsImpl( sessionFactory.getCache().getQueryResultsCache( regionName ).getRegion() ) ); }
@Override public CacheRegionStatisticsImpl getCacheRegionStatistics(String regionName) { if ( sessionFactory == null ) { return null; } if ( ! sessionFactory.getSessionFactoryOptions().isSecondLevelCacheEnabled() ) { return null; } return l2CacheStatsMap.computeIfAbsent( regionName, s -> { Region region = sessionFactory.getCache().getRegion( regionName ); if ( region == null ) { // this is the pre-5.3 behavior. and since this is a pre-5.3 method it should behave consistently // NOTE that this method is deprecated region = sessionFactory.getCache().getQueryResultsCache( regionName ).getRegion(); } return new CacheRegionStatisticsImpl( region ); } ); }
private static QueryCachePutManager resolveQueryCachePutManager( ExecutionContext executionContext, QueryOptions queryOptions, QueryKey queryCacheKey) { final boolean queryCacheEnabled = executionContext.getSession() .getFactory() .getSessionFactoryOptions() .isQueryCacheEnabled(); final CacheMode cacheMode = queryOptions.getCacheMode(); if ( queryCacheEnabled && cacheMode.isPutEnabled() ) { final QueryResultsCache queryCache = executionContext.getSession().getFactory() .getCache() .getQueryResultsCache( queryOptions.getResultCacheRegionName() ); return new QueryCachePutManagerEnabledImpl( queryCache, queryCacheKey ); } else { return QueryCachePutManagerDisabledImpl.INSTANCE; } }
.getQueryResultsCache( executionContext.getQueryOptions().getResultCacheRegionName() );