Package org.hibernate.query.spi
Interface QueryInterpretationCache
- All Known Implementing Classes:
QueryInterpretationCacheDisabledImpl
,QueryInterpretationCacheStandardImpl
Cache for various parts of translating or interpreting queries.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
close()
Close the cache when the SessionFactory is closed.int
int
boolean
<R> HqlInterpretation<R>
resolveHqlInterpretation
(String queryString, Class<R> expectedResultType, HqlTranslator translator) resolveNativeQueryParameters
(String queryString, Function<String, ParameterInterpretation> creator) <R> SelectQueryPlan<R>
resolveSelectQueryPlan
(QueryInterpretationCache.Key key, Supplier<SelectQueryPlan<R>> creator)
-
Method Details
-
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
-
cacheNonSelectQueryPlan
-
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.
-