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