Package org.hibernate.query.spi
Interface QueryPlanCache
-
public interface QueryPlanCacheA cache forQueryPlans used (and produced) by the translation and execution of a query.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceQueryPlanCache.Key
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcacheNonSelectQueryPlan(QueryPlanCache.Key key, NonSelectQueryPlan plan)voidcacheSelectQueryPlan(QueryPlanCache.Key key, SelectQueryPlan plan)voidcacheSqmStatement(String key, SqmStatement sqmStatement)voidclose()Close the cache when the SessionFactory is closed.NonSelectQueryPlangetNonSelectQueryPlan(QueryPlanCache.Key key)SelectQueryPlangetSelectQueryPlan(QueryPlanCache.Key key)SqmStatementgetSqmStatement(String queryString)
-
-
-
Method Detail
-
getSelectQueryPlan
SelectQueryPlan getSelectQueryPlan(QueryPlanCache.Key key)
-
cacheSelectQueryPlan
void cacheSelectQueryPlan(QueryPlanCache.Key key, SelectQueryPlan plan)
-
getNonSelectQueryPlan
NonSelectQueryPlan getNonSelectQueryPlan(QueryPlanCache.Key key)
-
cacheNonSelectQueryPlan
void cacheNonSelectQueryPlan(QueryPlanCache.Key key, NonSelectQueryPlan plan)
-
getSqmStatement
SqmStatement getSqmStatement(String queryString)
-
cacheSqmStatement
void cacheSqmStatement(String key, SqmStatement sqmStatement)
-
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.
-
-