org.hibernate.engine.query.spi
Class QueryPlanCache

java.lang.Object
  extended by org.hibernate.engine.query.spi.QueryPlanCache
All Implemented Interfaces:
Serializable

public class QueryPlanCache
extends Object
implements Serializable

Acts as a cache for compiled query plans, as well as query-parameter metadata.

See Also:
AvailableSettings.QUERY_PLAN_CACHE_PARAMETER_METADATA_MAX_SIZE, AvailableSettings.QUERY_PLAN_CACHE_MAX_SIZE, Serialized Form

Field Summary
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 Summary
QueryPlanCache(SessionFactoryImplementor factory)
           
 
Method Summary
 void cleanup()
           
 FilterQueryPlan getFilterQueryPlan(String filterString, String collectionRole, boolean shallow, Map enabledFilters)
           
 HQLQueryPlan getHQLQueryPlan(String queryString, boolean shallow, Map enabledFilters)
           
 NativeSQLQueryPlan getNativeSQLQueryPlan(NativeSQLQuerySpecification spec)
           
 ParameterMetadata getSQLParameterMetadata(String query)
          Obtain the parameter metadata for given native-sql query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PARAMETER_METADATA_MAX_COUNT

public static final int DEFAULT_PARAMETER_METADATA_MAX_COUNT
The default strong reference count.

See Also:
Constant Field Values

DEFAULT_QUERY_PLAN_MAX_COUNT

public static final int DEFAULT_QUERY_PLAN_MAX_COUNT
The default soft reference count.

See Also:
Constant Field Values
Constructor Detail

QueryPlanCache

public QueryPlanCache(SessionFactoryImplementor factory)
Method Detail

getSQLParameterMetadata

public ParameterMetadata getSQLParameterMetadata(String query)
Obtain the parameter metadata for given native-sql query.

for native-sql queries, the param metadata is determined outside any relation to a query plan, because query plan creation and/or retrieval for a native-sql query depends on all of the return types having been set, which might not be the case up-front when param metadata would be most useful

Parameters:
query - The query
Returns:
The parameter metadata

getHQLQueryPlan

public HQLQueryPlan getHQLQueryPlan(String queryString,
                                    boolean shallow,
                                    Map enabledFilters)
                             throws QueryException,
                                    MappingException
Throws:
QueryException
MappingException

getFilterQueryPlan

public FilterQueryPlan getFilterQueryPlan(String filterString,
                                          String collectionRole,
                                          boolean shallow,
                                          Map enabledFilters)
                                   throws QueryException,
                                          MappingException
Throws:
QueryException
MappingException

getNativeSQLQueryPlan

public NativeSQLQueryPlan getNativeSQLQueryPlan(NativeSQLQuerySpecification spec)

cleanup

public void cleanup()


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.