/** * @deprecated No replacement - added just for support of the newly deprecated methods expecting a qualified region name */ @Deprecated default Region getRegionByLegacyName(String legacyName) { return getRegion( unqualifyRegionName( legacyName ) ); }
/** * @deprecated Use {@link #getQueryResultsCache(String)} instead, but using unqualified name */ @Deprecated default QueryCache getQueryCache(String regionName) throws HibernateException { return getQueryResultsCache( unqualifyRegionName( regionName ) ); }
@Override public CacheRegionStatisticsImpl getSecondLevelCacheStatistics(String regionName) { if ( sessionFactory == null ) { return null; } return getCacheRegionStatistics( sessionFactory.getCache().unqualifyRegionName( regionName ) ); }
@Override public DeprecatedNaturalIdCacheStatisticsImpl getNaturalIdCacheStatistics(String regionName) { return deprecatedNaturalIdStatsMap.computeIfAbsent( sessionFactory.getCache().unqualifyRegionName( regionName ), unqualifiedRegionName -> new DeprecatedNaturalIdCacheStatisticsImpl( unqualifiedRegionName, sessionFactory.getCache().getNaturalIdAccessesInRegion( unqualifiedRegionName ) ) ); }
@Test public void testValidCall() { MatcherAssert.assertThat( sessionFactory().getCache().unqualifyRegionName( PREFIX + '.' + LOCAL_NAME ), CoreMatchers.is( LOCAL_NAME ) ); }
@Test public void testUnqualifiedNameUsed() { try { sessionFactory().getCache().unqualifyRegionName( LOCAL_NAME ); } catch (IllegalArgumentException expected) { } } }
/** * @deprecated No replacement - added just for support of the newly deprecated methods expecting a qualified region name */ @Deprecated default Region getRegionByLegacyName(String legacyName) { return getRegion( unqualifyRegionName( legacyName ) ); }
@Override public CacheRegionStatisticsImpl getSecondLevelCacheStatistics(String regionName) { if ( sessionFactory == null ) { return null; } return getCacheRegionStatistics( sessionFactory.getCache().unqualifyRegionName( regionName ) ); }