Package org.hibernate.query.internal
Class QueryInterpretationCacheStandardImpl
java.lang.Object
org.hibernate.query.internal.QueryInterpretationCacheStandardImpl
- All Implemented Interfaces:
QueryInterpretationCache
public class QueryInterpretationCacheStandardImpl
extends Object
implements QueryInterpretationCache
Standard QueryInterpretationCache implementation
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.query.spi.QueryInterpretationCache
QueryInterpretationCache.Key
-
Constructor Summary
ConstructorsConstructorDescriptionQueryInterpretationCacheStandardImpl
(int maxQueryPlanCount, ServiceRegistry serviceRegistry) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
close()
Close the cache when the SessionFactory is closed.protected static <R> HqlInterpretation<R>
createHqlInterpretation
(String queryString, Class<R> expectedResultType, HqlTranslator translator, StatisticsImplementor statistics) 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)
-
Constructor Details
-
QueryInterpretationCacheStandardImpl
-
-
Method Details
-
getNumberOfCachedHqlInterpretations
public int getNumberOfCachedHqlInterpretations()- Specified by:
getNumberOfCachedHqlInterpretations
in interfaceQueryInterpretationCache
-
getNumberOfCachedQueryPlans
public int getNumberOfCachedQueryPlans()- Specified by:
getNumberOfCachedQueryPlans
in interfaceQueryInterpretationCache
-
resolveSelectQueryPlan
public <R> SelectQueryPlan<R> resolveSelectQueryPlan(QueryInterpretationCache.Key key, Supplier<SelectQueryPlan<R>> creator) - Specified by:
resolveSelectQueryPlan
in interfaceQueryInterpretationCache
-
getNonSelectQueryPlan
- Specified by:
getNonSelectQueryPlan
in interfaceQueryInterpretationCache
-
cacheNonSelectQueryPlan
- Specified by:
cacheNonSelectQueryPlan
in interfaceQueryInterpretationCache
-
resolveHqlInterpretation
public <R> HqlInterpretation<R> resolveHqlInterpretation(String queryString, Class<R> expectedResultType, HqlTranslator translator) - Specified by:
resolveHqlInterpretation
in interfaceQueryInterpretationCache
-
createHqlInterpretation
protected static <R> HqlInterpretation<R> createHqlInterpretation(String queryString, Class<R> expectedResultType, HqlTranslator translator, StatisticsImplementor statistics) -
resolveNativeQueryParameters
public ParameterInterpretation resolveNativeQueryParameters(String queryString, Function<String, ParameterInterpretation> creator) - Specified by:
resolveNativeQueryParameters
in interfaceQueryInterpretationCache
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceQueryInterpretationCache
-
close
public void close()Description copied from interface:QueryInterpretationCache
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.
- Specified by:
close
in interfaceQueryInterpretationCache
-