public class QueryPlanCache
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PARAMETER_METADATA_MAX_COUNT
The default strong reference count.
|
static int |
DEFAULT_QUERY_PLAN_MAX_COUNT
The default soft reference count.
|
Constructor and Description |
---|
QueryPlanCache(SessionFactoryImplementor factory)
Constructs the QueryPlanCache to be used by the given SessionFactory
|
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
clean up QueryPlanCache when SessionFactory is closed
|
FilterQueryPlan |
getFilterQueryPlan(java.lang.String filterString,
java.lang.String collectionRole,
boolean shallow,
java.util.Map<java.lang.String,Filter> enabledFilters)
Get the query plan for the given collection HQL filter fragment, creating it and caching it if not already cached
|
HQLQueryPlan |
getHQLQueryPlan(java.lang.String queryString,
boolean shallow,
java.util.Map<java.lang.String,Filter> enabledFilters)
Get the query plan for the given HQL query, creating it and caching it if not already cached
|
NativeQueryInterpreter |
getNativeQueryInterpreter() |
NativeSQLQueryPlan |
getNativeSQLQueryPlan(NativeSQLQuerySpecification spec)
Get the query plan for a native SQL query, creating it and caching it if not already cached
|
ParameterMetadata |
getSQLParameterMetadata(java.lang.String query,
boolean isOrdinalParameterZeroBased)
Obtain the parameter metadata for given native-sql query.
|
public static final int DEFAULT_PARAMETER_METADATA_MAX_COUNT
public static final int DEFAULT_QUERY_PLAN_MAX_COUNT
public QueryPlanCache(SessionFactoryImplementor factory)
factory
- The SessionFactorypublic ParameterMetadata getSQLParameterMetadata(java.lang.String query, boolean isOrdinalParameterZeroBased)
query
- The querypublic HQLQueryPlan getHQLQueryPlan(java.lang.String queryString, boolean shallow, java.util.Map<java.lang.String,Filter> enabledFilters) throws QueryException, MappingException
queryString
- The HQL query stringshallow
- Whether the execution will be shallowenabledFilters
- The filters enabled on the SessionQueryException
- Indicates a problem translating the queryMappingException
- Indicates a problem translating the querypublic FilterQueryPlan getFilterQueryPlan(java.lang.String filterString, java.lang.String collectionRole, boolean shallow, java.util.Map<java.lang.String,Filter> enabledFilters) throws QueryException, MappingException
filterString
- The HQL filter fragmentcollectionRole
- The collection being filteredshallow
- Whether the execution will be shallowenabledFilters
- The filters enabled on the SessionQueryException
- Indicates a problem translating the queryMappingException
- Indicates a problem translating the querypublic NativeSQLQueryPlan getNativeSQLQueryPlan(NativeSQLQuerySpecification spec)
spec
- The native SQL query specificationQueryException
- Indicates a problem translating the queryMappingException
- Indicates a problem translating the querypublic void cleanup()
public NativeQueryInterpreter getNativeQueryInterpreter()
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.