Top Fields Constructors Methods
org.hibernate.engine.spi

public final Class QueryParameters

extends Object
Class Inheritance
Imports
java.io.Serializable, java.util.ArrayList, .Collection, .Iterator, .List, .Map, .StringTokenizer, org.hibernate.HibernateException, .LockOptions, .QueryException, .ScrollMode, org.hibernate.engine.query.spi.HQLQueryPlan, org.hibernate.hql.internal.classic.ParserHelper, org.hibernate.internal.CoreLogging, .FilterImpl, org.hibernate.internal.util.EntityPrinter, org.hibernate.internal.util.collections.ArrayHelper, org.hibernate.query.internal.QueryParameterBindingsImpl, org.hibernate.query.spi.QueryParameterBindings, org.hibernate.transform.ResultTransformer, org.hibernate.type.ComponentType, .Type, org.jboss.logging.Logger

Author
Gavin King

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private String
private boolean
private Serializable[]
private String
private boolean
private boolean
private LockOptions
private static final Logger
private Map<String, TypedValue>
private String
private Serializable
private Object
private boolean
private Type[]
private Object[]
private Type[]
private Object[]
private String
private List<String>
private HQLQueryPlan
private boolean
private final ResultTransformer
private RowSelection
private ScrollMode
private static final String
SYMBOLS

Symbols used to split SQL string into tokens in processFilters(String, Map, SessionFactoryImplementor).

Constructor Summary

AccessConstructor and Description
public
public
public
QueryParameters(final Type[] positionalParameterTypes, final Object[] positionalParameterValues, final Object optionalObject, final String optionalEntityName, final Serializable optionalObjectId)

public
QueryParameters(final Type[] positionalParameterTypes, final Object[] positionalParameterValues)

public
QueryParameters(final Type[] positionalParameterTypes, final Object[] positionalParameterValues, final Serializable[] collectionKeys)

public
QueryParameters(final Type[] positionalParameterTypes, final Object[] positionalParameterValues, final Map<String, TypedValue> namedParameters, final Serializable[] collectionKeys)

public
QueryParameters(final Type[] positionalParameterTypes, final Object[] positionalParameterValues, final LockOptions lockOptions, final RowSelection rowSelection, final boolean isReadOnlyInitialized, final boolean readOnly, final boolean cacheable, final String cacheRegion, final String comment, final List<String> queryHints, final boolean isLookupByNaturalKey, final ResultTransformer transformer)

public
QueryParameters(final Type[] positionalParameterTypes, final Object[] positionalParameterValues, final Map<String, TypedValue> namedParameters, final LockOptions lockOptions, final RowSelection rowSelection, final boolean isReadOnlyInitialized, final boolean readOnly, final boolean cacheable, final String cacheRegion, final String comment, final List<String> queryHints, final Serializable[] collectionKeys, ResultTransformer transformer)

public
QueryParameters(final Type[] positionalParameterTypes, final Object[] positionalParameterValues, final Map<String, TypedValue> namedParameters, final LockOptions lockOptions, final RowSelection rowSelection, final boolean isReadOnlyInitialized, final boolean readOnly, final boolean cacheable, final String cacheRegion, final String comment, final List<String> queryHints, final Serializable[] collectionKeys, final Object optionalObject, final String optionalEntityName, final Serializable optionalId, final ResultTransformer transformer)

public
QueryParameters(QueryParameterBindings queryParameterBindings, LockOptions lockOptions, RowSelection selection, final boolean isReadOnlyInitialized, boolean readOnly, boolean cacheable, String cacheRegion, String comment, List<String> dbHints, final Serializable[] collectionKeys, final Object optionalObject, final String optionalEntityName, final Serializable optionalId, ResultTransformer resultTransformer)

Method Summary

Modifier and TypeMethod and Description
public void
bindDynamicParameter(Type paramType, Object paramValue)

public QueryParameters
public String
public Serializable[]
public String
public Type[]
public Object[]
public String
public LockOptions
public Map<String, TypedValue>
private int
public String
public Serializable
public Object
public Type[]
public Object[]
public List<String>
public HQLQueryPlan
public ResultTransformer
public RowSelection
public ScrollMode
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean

Returns:

the query passes distinct to the database
isPassDistinctThrough
()

Check if this query should pass the distinct to the database.

public boolean

Returns:

true, entities and proxies loaded by the Query will be put in read-only mode false, entities and proxies loaded by the Query will be put in modifiable mode
isReadOnly
()

Should entities and proxies loaded by the Query be put in read-only mode?

public boolean

Returns:

true indicates that entities and proxies loaded by the query will be put in read-only mode; false indicates that entities and proxies loaded by the query will be put in modifiable mode
isReadOnly
(SharedSessionContractImplementor
The originating session
session
)

Should entities and proxies loaded by the Query be put in read-only mode?

public boolean

Returns:

true, the read-only/modifiable mode was explicitly set false, the read-only/modifiable mode was not explicitly set
isReadOnlyInitialized
()

Has the read-only/modifiable mode been explicitly set?

public void
public void
processFilters(String sql, Map<K, V> filters, SessionFactoryImplementor factory)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
public void
setAutoDiscoverScalarTypes(boolean autodiscovertypes)

public void
setCacheable(boolean b)

public void
setCacheRegion(String cacheRegion)

public void
setCallable(boolean callable)

public void
setCollectionKeys(Serializable[] collectionKeys)

public void
setComment(String comment)

public void
public void
public void
setNaturalKeyLookup(boolean isNaturalKeyLookup)

public void
setOptionalEntityName(String optionalEntityName)

public void
public void
setOptionalObject(Object optionalObject)

public void
setPassDistinctThrough(boolean
the query passes distinct to the database
passDistinctThrough
)

Set if this query should pass the distinct to the database.

public void
public void
public void
setQueryHints(List<String> queryHints)

public void
public void
setReadOnly(boolean
if true, entities and proxies loaded by the query will be put in read-only mode; if false, entities and proxies loaded by the query will be put in modifiable mode
readOnly
)

Set the read-only/modifiable mode for entities and proxies loaded by the query.

public void
public void
public void
traceParameters(SessionFactoryImplementor factory)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

autodiscovertypesback to summary
private boolean autodiscovertypes
cacheableback to summary
private boolean cacheable
cacheRegionback to summary
private String cacheRegion
callableback to summary
private boolean callable
collectionKeysback to summary
private Serializable[] collectionKeys
commentback to summary
private String comment
isNaturalKeyLookupback to summary
private boolean isNaturalKeyLookup
isReadOnlyInitializedback to summary
private boolean isReadOnlyInitialized
lockOptionsback to summary
private LockOptions lockOptions
LOGback to summary
private static final Logger LOG
namedParametersback to summary
private Map<String, TypedValue> namedParameters
optionalEntityNameback to summary
private String optionalEntityName
optionalIdback to summary
private Serializable optionalId
optionalObjectback to summary
private Object optionalObject
passDistinctThroughback to summary
private boolean passDistinctThrough
positionalParameterTypesback to summary
private Type[] positionalParameterTypes
positionalParameterValuesback to summary
private Object[] positionalParameterValues
processedPositionalParameterTypesback to summary
private Type[] processedPositionalParameterTypes
processedPositionalParameterValuesback to summary
private Object[] processedPositionalParameterValues
processedSQLback to summary
private String processedSQL
queryHintsback to summary
private List<String> queryHints
queryPlanback to summary
private HQLQueryPlan queryPlan
readOnlyback to summary
private boolean readOnly
resultTransformerback to summary
private final ResultTransformer resultTransformer
rowSelectionback to summary
private RowSelection rowSelection
scrollModeback to summary
private ScrollMode scrollMode
SYMBOLSback to summary
private static final String SYMBOLS

Symbols used to split SQL string into tokens in processFilters(String, Map, SessionFactoryImplementor).

Constructor Detail

QueryParametersback to summary
public QueryParameters()
QueryParametersback to summary
public QueryParameters(Type type, Object value)
QueryParametersback to summary
public QueryParameters(final Type[] positionalParameterTypes, final Object[] positionalParameterValues, final Object optionalObject, final String optionalEntityName, final Serializable optionalObjectId)
QueryParametersback to summary
public QueryParameters(final Type[] positionalParameterTypes, final Object[] positionalParameterValues)
QueryParametersback to summary
public QueryParameters(final Type[] positionalParameterTypes, final Object[] positionalParameterValues, final Serializable[] collectionKeys)
QueryParametersback to summary
public QueryParameters(final Type[] positionalParameterTypes, final Object[] positionalParameterValues, final Map<String, TypedValue> namedParameters, final Serializable[] collectionKeys)
QueryParametersback to summary
public QueryParameters(final Type[] positionalParameterTypes, final Object[] positionalParameterValues, final LockOptions lockOptions, final RowSelection rowSelection, final boolean isReadOnlyInitialized, final boolean readOnly, final boolean cacheable, final String cacheRegion, final String comment, final List<String> queryHints, final boolean isLookupByNaturalKey, final ResultTransformer transformer)
QueryParametersback to summary
public QueryParameters(final Type[] positionalParameterTypes, final Object[] positionalParameterValues, final Map<String, TypedValue> namedParameters, final LockOptions lockOptions, final RowSelection rowSelection, final boolean isReadOnlyInitialized, final boolean readOnly, final boolean cacheable, final String cacheRegion, final String comment, final List<String> queryHints, final Serializable[] collectionKeys, ResultTransformer transformer)
QueryParametersback to summary
public QueryParameters(final Type[] positionalParameterTypes, final Object[] positionalParameterValues, final Map<String, TypedValue> namedParameters, final LockOptions lockOptions, final RowSelection rowSelection, final boolean isReadOnlyInitialized, final boolean readOnly, final boolean cacheable, final String cacheRegion, final String comment, final List<String> queryHints, final Serializable[] collectionKeys, final Object optionalObject, final String optionalEntityName, final Serializable optionalId, final ResultTransformer transformer)
QueryParametersback to summary
public QueryParameters(QueryParameterBindings queryParameterBindings, LockOptions lockOptions, RowSelection selection, final boolean isReadOnlyInitialized, boolean readOnly, boolean cacheable, String cacheRegion, String comment, List<String> dbHints, final Serializable[] collectionKeys, final Object optionalObject, final String optionalEntityName, final Serializable optionalId, ResultTransformer resultTransformer)

Method Detail

bindDynamicParameterback to summary
public void bindDynamicParameter(Type paramType, Object paramValue)
createCopyUsingback to summary
public QueryParameters createCopyUsing(RowSelection selection)
getCacheRegionback to summary
public String getCacheRegion()
getCollectionKeysback to summary
public Serializable[] getCollectionKeys()
getCommentback to summary
public String getComment()
getFilteredPositionalParameterTypesback to summary
public Type[] getFilteredPositionalParameterTypes()
getFilteredPositionalParameterValuesback to summary
public Object[] getFilteredPositionalParameterValues()
getFilteredSQLback to summary
public String getFilteredSQL()
getLockOptionsback to summary
public LockOptions getLockOptions()
getNamedParametersback to summary
public Map<String, TypedValue> getNamedParameters()
getNumberOfParametersCoveredByback to summary
private int getNumberOfParametersCoveredBy(Type[] subtypes)
getOptionalEntityNameback to summary
public String getOptionalEntityName()
getOptionalIdback to summary
public Serializable getOptionalId()
getOptionalObjectback to summary
public Object getOptionalObject()
getPositionalParameterTypesback to summary
public Type[] getPositionalParameterTypes()
getPositionalParameterValuesback to summary
public Object[] getPositionalParameterValues()
getQueryHintsback to summary
public List<String> getQueryHints()
getQueryPlanback to summary
public HQLQueryPlan getQueryPlan()
getResultTransformerback to summary
public ResultTransformer getResultTransformer()
getRowSelectionback to summary
public RowSelection getRowSelection()
getScrollModeback to summary
public ScrollMode getScrollMode()
hasAutoDiscoverScalarTypesback to summary
public boolean hasAutoDiscoverScalarTypes()
hasRowSelectionback to summary
public boolean hasRowSelection()
Annotations
@SuppressWarnings:UnusedDeclaration
isCacheableback to summary
public boolean isCacheable()
isCallableback to summary
public boolean isCallable()
isNaturalKeyLookupback to summary
public boolean isNaturalKeyLookup()
isPassDistinctThroughback to summary
public boolean isPassDistinctThrough()

Check if this query should pass the distinct to the database.

Returns:boolean

the query passes distinct to the database

isReadOnlyback to summary
public boolean isReadOnly()

Should entities and proxies loaded by the Query be put in read-only mode? The read-only/modifiable setting must be initialized via QueryParameters#setReadOnly(boolean) before calling this method.

Returns:boolean

true, entities and proxies loaded by the Query will be put in read-only mode false, entities and proxies loaded by the Query will be put in modifiable mode

Exceptions
IllegalStateException:
if the read-only/modifiable setting has not been initialized (i.e., isReadOnlyInitialized() == false).
See Also
QueryParameters#isReadOnlyInitialized(), QueryParameters#isReadOnly(SharedSessionContractImplementor), The read-only/modifiable setting has no impact on entities/proxies returned by the query that existed in the session before the query was executed.
isReadOnlyback to summary
public boolean isReadOnly(SharedSessionContractImplementor session)

Should entities and proxies loaded by the Query be put in read-only mode? If the read-only/modifiable setting was not initialized (i.e., QueryParameters#isReadOnlyInitialized() == false), then the default read-only/modifiable setting for the persistence context is returned instead.

The read-only/modifiable setting has no impact on entities/proxies returned by the query that existed in the session before the query was executed.

Parameters
session:SharedSessionContractImplementor

The originating session

Returns:boolean

true indicates that entities and proxies loaded by the query will be put in read-only mode; false indicates that entities and proxies loaded by the query will be put in modifiable mode

See Also
QueryParameters#isReadOnlyInitialized(), QueryParameters#setReadOnly(boolean), The read-only/modifiable setting has no impact on entities/proxies returned by the query that existed in the session before the query was executed.
isReadOnlyInitializedback to summary
public boolean isReadOnlyInitialized()

Has the read-only/modifiable mode been explicitly set?

Returns:boolean

true, the read-only/modifiable mode was explicitly set false, the read-only/modifiable mode was not explicitly set

See Also
QueryParameters#setReadOnly(boolean), QueryParameters#isReadOnly(SharedSessionContractImplementor)
processFiltersback to summary
public void processFilters(String sql, SharedSessionContractImplementor session)
processFiltersback to summary
public void processFilters(String sql, Map<K, V> filters, SessionFactoryImplementor factory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Annotations
@SuppressWarnings:unchecked
setAutoDiscoverScalarTypesback to summary
public void setAutoDiscoverScalarTypes(boolean autodiscovertypes)
setCacheableback to summary
public void setCacheable(boolean b)
setCacheRegionback to summary
public void setCacheRegion(String cacheRegion)
setCallableback to summary
public void setCallable(boolean callable)
setCollectionKeysback to summary
public void setCollectionKeys(Serializable[] collectionKeys)
Annotations
@SuppressWarnings:UnusedDeclaration
setCommentback to summary
public void setComment(String comment)
setLockOptionsback to summary
public void setLockOptions(LockOptions lockOptions)
setNamedParametersback to summary
public void setNamedParameters(Map<String, TypedValue> map)
Annotations
@SuppressWarnings:UnusedDeclaration
setNaturalKeyLookupback to summary
public void setNaturalKeyLookup(boolean isNaturalKeyLookup)
Annotations
@SuppressWarnings:UnusedDeclaration
setOptionalEntityNameback to summary
public void setOptionalEntityName(String optionalEntityName)
setOptionalIdback to summary
public void setOptionalId(Serializable optionalId)
setOptionalObjectback to summary
public void setOptionalObject(Object optionalObject)
setPassDistinctThroughback to summary
public void setPassDistinctThrough(boolean passDistinctThrough)

Set if this query should pass the distinct to the database.

Parameters
passDistinctThrough:boolean

the query passes distinct to the database

setPositionalParameterTypesback to summary
public void setPositionalParameterTypes(Type[] types)
setPositionalParameterValuesback to summary
public void setPositionalParameterValues(Object[] objects)
setQueryHintsback to summary
public void setQueryHints(List<String> queryHints)
setQueryPlanback to summary
public void setQueryPlan(HQLQueryPlan queryPlan)
setReadOnlyback to summary
public void setReadOnly(boolean readOnly)

Set the read-only/modifiable mode for entities and proxies loaded by the query.

The read-only/modifiable setting has no impact on entities/proxies returned by the query that existed in the session before the query was executed.

Parameters
readOnly:boolean

if true, entities and proxies loaded by the query will be put in read-only mode; if false, entities and proxies loaded by the query will be put in modifiable mode

See Also
QueryParameters#isReadOnlyInitialized(), QueryParameters#isReadOnly(SharedSessionContractImplementor), QueryParameters#setReadOnly(boolean), org.hibernate.engine.spi.PersistenceContext#isDefaultReadOnly()
setRowSelectionback to summary
public void setRowSelection(RowSelection selection)
Annotations
@SuppressWarnings:UnusedDeclaration
setScrollModeback to summary
public void setScrollMode(ScrollMode scrollMode)
traceParametersback to summary
public void traceParameters(SessionFactoryImplementor factory) throws HibernateException

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

validateParametersback to summary
public void validateParameters() throws QueryException