public class QueryPlanCache extends Object implements 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(String filterString,
String collectionRole,
boolean shallow,
Map<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(String queryString,
boolean shallow,
Map<String,Filter> enabledFilters)
Get the query plan for the given HQL query, creating it and caching it if not already cached
|
NativeSQLQueryPlan |
getNativeSQLQueryPlan(NativeSQLQuerySpecification spec)
Get the query plan for a native SQL query, creating it and caching it if not already cached
|
ParameterMetadata |
getSQLParameterMetadata(String query)
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(String query)
query
- The querypublic HQLQueryPlan getHQLQueryPlan(String queryString, boolean shallow, Map<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(String filterString, String collectionRole, boolean shallow, Map<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()
Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.