Top Description Inners Methods
org.hibernate.query.spi

public Interface QueryInterpretationCache

Known Direct Implementers
org.hibernate.query.internal.QueryInterpretationCacheDisabledImpl, org.hibernate.query.internal.QueryInterpretationCacheStandardImpl
Annotations
@Incubating
Imports
java.util.function.Function, .Supplier, org.hibernate.Incubating, org.hibernate.query.hql.HqlTranslator, org.hibernate.query.sql.spi.ParameterInterpretation, org.hibernate.query.sqm.tree.SqmStatement

Cache for various parts of translating or interpreting queries.
Author
Steve Ebersole
See Also
org.hibernate.cfg.AvailableSettings#QUERY_PLAN_CACHE_ENABLED, org.hibernate.cfg.AvailableSettings#QUERY_PLAN_CACHE_MAX_SIZE

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Method Summary

Modifier and TypeMethod and Description
public void
public void
close()

Close the cache when the SessionFactory is closed.

public NonSelectQueryPlan
public int
public int
public boolean
public HqlInterpretation
resolveHqlInterpretation(String queryString, Class<?> expectedResultType, Function<String, SqmStatement<?>> creator)

Deprecated for removal.
public default HqlInterpretation
resolveHqlInterpretation(String queryString, Class<?> expectedResultType, HqlTranslator translator)

public ParameterInterpretation
public <R> SelectQueryPlan<R>

Method Detail

cacheNonSelectQueryPlanback to summary
public void cacheNonSelectQueryPlan(QueryInterpretationCache.Key key, NonSelectQueryPlan plan)
closeback to summary
public 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.

getNonSelectQueryPlanback to summary
public NonSelectQueryPlan getNonSelectQueryPlan(QueryInterpretationCache.Key key)
getNumberOfCachedHqlInterpretationsback to summary
public int getNumberOfCachedHqlInterpretations()
getNumberOfCachedQueryPlansback to summary
public int getNumberOfCachedQueryPlans()
isEnabledback to summary
public boolean isEnabled()
resolveHqlInterpretationback to summary
public HqlInterpretation resolveHqlInterpretation(String queryString, Class<?> expectedResultType, Function<String, SqmStatement<?>> creator)

Deprecated

for removal.

Annotations
@Deprecated
forRemoval:true
resolveHqlInterpretationback to summary
public default HqlInterpretation resolveHqlInterpretation(String queryString, Class<?> expectedResultType, HqlTranslator translator)
resolveNativeQueryParametersback to summary
public ParameterInterpretation resolveNativeQueryParameters(String queryString, Function<String, ParameterInterpretation> creator)
resolveSelectQueryPlanback to summary
public <R> SelectQueryPlan<R> resolveSelectQueryPlan(QueryInterpretationCache.Key key, Supplier<SelectQueryPlan<R>> creator)
org.hibernate.query.spi back to summary

public Interface QueryInterpretationCache.Key

Known Direct Implementers
org.hibernate.query.sql.spi.NonSelectInterpretationsKey, org.hibernate.query.sql.spi.SelectInterpretationsKey, org.hibernate.query.sqm.internal.SqmInterpretationsKey

Method Summary

Modifier and TypeMethod and Description
public String
public default QueryInterpretationCache.Key
prepareForStore()

The possibility for a cache key to do defensive copying in case it has mutable state.

Method Detail

getQueryStringback to summary
public String getQueryString()
prepareForStoreback to summary
public default QueryInterpretationCache.Key prepareForStore()

The possibility for a cache key to do defensive copying in case it has mutable state.