Package org.hibernate.query.spi
Interface QueryInterpretationCache
-
- All Known Implementing Classes:
QueryInterpretationCacheDisabledImpl
,QueryInterpretationCacheStandardImpl
@Incubating public interface QueryInterpretationCache
Cache for various parts of translating or interpreting queries.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
QueryInterpretationCache.Key
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cacheNonSelectQueryPlan(QueryInterpretationCache.Key key, NonSelectQueryPlan plan)
void
close()
Close the cache when the SessionFactory is closed.NonSelectQueryPlan
getNonSelectQueryPlan(QueryInterpretationCache.Key key)
int
getNumberOfCachedHqlInterpretations()
int
getNumberOfCachedQueryPlans()
boolean
isEnabled()
<R> HqlInterpretation<R>
resolveHqlInterpretation(String queryString, Class<R> expectedResultType, HqlTranslator translator)
ParameterInterpretation
resolveNativeQueryParameters(String queryString, Function<String,ParameterInterpretation> creator)
<R> SelectQueryPlan<R>
resolveSelectQueryPlan(QueryInterpretationCache.Key key, Supplier<SelectQueryPlan<R>> creator)
-
-
-
Method Detail
-
getNumberOfCachedHqlInterpretations
int getNumberOfCachedHqlInterpretations()
-
getNumberOfCachedQueryPlans
int getNumberOfCachedQueryPlans()
-
resolveHqlInterpretation
<R> HqlInterpretation<R> resolveHqlInterpretation(String queryString, Class<R> expectedResultType, HqlTranslator translator)
-
resolveSelectQueryPlan
<R> SelectQueryPlan<R> resolveSelectQueryPlan(QueryInterpretationCache.Key key, Supplier<SelectQueryPlan<R>> creator)
-
getNonSelectQueryPlan
NonSelectQueryPlan getNonSelectQueryPlan(QueryInterpretationCache.Key key)
-
cacheNonSelectQueryPlan
void cacheNonSelectQueryPlan(QueryInterpretationCache.Key key, NonSelectQueryPlan plan)
-
resolveNativeQueryParameters
ParameterInterpretation resolveNativeQueryParameters(String queryString, Function<String,ParameterInterpretation> creator)
-
isEnabled
boolean isEnabled()
-
close
void close()
Close the cache when the SessionFactory is closed.Note that depending on the cache strategy implementation chosen, clearing the cache might not reclaim all the memory.
Typically, when using LIRS, clearing the cache only invalidates the entries but the outdated entries are kept in memory until they are replaced by others. It is not considered a memory leak as the cache is bounded.
-
-