org.hibernate.engine
Class QueryParameters

java.lang.Object
  extended by org.hibernate.engine.QueryParameters

public final class QueryParameters
extends Object

Author:
Gavin King

Constructor Summary
QueryParameters()
           
QueryParameters(Type[] positionalParameterTypes, Object[] postionalParameterValues)
           
QueryParameters(Type[] positionalParameterTypes, Object[] positionalParameterValues, LockOptions lockOptions, RowSelection rowSelection, boolean isReadOnlyInitialized, boolean readOnly, boolean cacheable, String cacheRegion, String comment, boolean isLookupByNaturalKey, ResultTransformer transformer)
           
QueryParameters(Type[] positionalParameterTypes, Object[] positionalParameterValues, Map namedParameters, LockOptions lockOptions, RowSelection rowSelection, boolean isReadOnlyInitialized, boolean readOnly, boolean cacheable, String cacheRegion, String comment, Serializable[] collectionKeys, Object optionalObject, String optionalEntityName, Serializable optionalId, ResultTransformer transformer)
           
QueryParameters(Type[] positionalParameterTypes, Object[] positionalParameterValues, Map namedParameters, LockOptions lockOptions, RowSelection rowSelection, boolean isReadOnlyInitialized, boolean readOnly, boolean cacheable, String cacheRegion, String comment, Serializable[] collectionKeys, ResultTransformer transformer)
           
QueryParameters(Type[] positionalParameterTypes, Object[] postionalParameterValues, Map namedParameters, Serializable[] collectionKeys)
           
QueryParameters(Type[] positionalParameterTypes, Object[] postionalParameterValues, Object optionalObject, String optionalEntityName, Serializable optionalObjectId)
           
QueryParameters(Type[] positionalParameterTypes, Object[] postionalParameterValues, Serializable[] collectionKeys)
           
QueryParameters(Type type, Object value)
           
 
Method Summary
 QueryParameters createCopyUsing(RowSelection selection)
           
 String getCacheRegion()
           
 Serializable[] getCollectionKeys()
           
 String getComment()
           
 Type[] getFilteredPositionalParameterTypes()
           
 Object[] getFilteredPositionalParameterValues()
           
 String getFilteredSQL()
           
 LockOptions getLockOptions()
           
 Map getNamedParameters()
           
 String getOptionalEntityName()
           
 Serializable getOptionalId()
           
 Object getOptionalObject()
           
 Type[] getPositionalParameterTypes()
           
 Object[] getPositionalParameterValues()
           
 ResultTransformer getResultTransformer()
           
 RowSelection getRowSelection()
           
 ScrollMode getScrollMode()
           
 boolean hasAutoDiscoverScalarTypes()
           
 boolean hasRowSelection()
           
 boolean isCacheable()
           
 boolean isCallable()
           
 boolean isNaturalKeyLookup()
           
 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.
 boolean isReadOnly(SessionImplementor 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.
 boolean isReadOnlyInitialized()
          Has the read-only/modifiable mode been explicitly set?
 void processFilters(String sql, Map filters, SessionFactoryImplementor factory)
           
 void processFilters(String sql, SessionImplementor session)
           
 void setAutoDiscoverScalarTypes(boolean autodiscovertypes)
           
 void setCacheable(boolean b)
           
 void setCacheRegion(String cacheRegion)
           
 void setCallable(boolean callable)
           
 void setCollectionKeys(Serializable[] collectionKeys)
           
 void setComment(String comment)
           
 void setLockOptions(LockOptions lockOptions)
           
 void setNamedParameters(Map map)
           
 void setNaturalKeyLookup(boolean isNaturalKeyLookup)
           
 void setOptionalEntityName(String optionalEntityName)
           
 void setOptionalId(Serializable optionalId)
           
 void setOptionalObject(Object optionalObject)
           
 void setPositionalParameterTypes(Type[] types)
           
 void setPositionalParameterValues(Object[] objects)
           
 void setReadOnly(boolean readOnly)
          Set the read-only/modifiable mode for entities and proxies loaded by the query.
 void setRowSelection(RowSelection selection)
           
 void setScrollMode(ScrollMode scrollMode)
           
 void traceParameters(SessionFactoryImplementor factory)
           
 void validateParameters()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryParameters

public QueryParameters()

QueryParameters

public QueryParameters(Type type,
                       Object value)

QueryParameters

public QueryParameters(Type[] positionalParameterTypes,
                       Object[] postionalParameterValues,
                       Object optionalObject,
                       String optionalEntityName,
                       Serializable optionalObjectId)

QueryParameters

public QueryParameters(Type[] positionalParameterTypes,
                       Object[] postionalParameterValues)

QueryParameters

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

QueryParameters

public QueryParameters(Type[] positionalParameterTypes,
                       Object[] postionalParameterValues,
                       Map namedParameters,
                       Serializable[] collectionKeys)

QueryParameters

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

QueryParameters

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

QueryParameters

public QueryParameters(Type[] positionalParameterTypes,
                       Object[] positionalParameterValues,
                       Map namedParameters,
                       LockOptions lockOptions,
                       RowSelection rowSelection,
                       boolean isReadOnlyInitialized,
                       boolean readOnly,
                       boolean cacheable,
                       String cacheRegion,
                       String comment,
                       Serializable[] collectionKeys,
                       Object optionalObject,
                       String optionalEntityName,
                       Serializable optionalId,
                       ResultTransformer transformer)
Method Detail

hasRowSelection

public boolean hasRowSelection()

getNamedParameters

public Map getNamedParameters()

getPositionalParameterTypes

public Type[] getPositionalParameterTypes()

getPositionalParameterValues

public Object[] getPositionalParameterValues()

getRowSelection

public RowSelection getRowSelection()

getResultTransformer

public ResultTransformer getResultTransformer()

setNamedParameters

public void setNamedParameters(Map map)

setPositionalParameterTypes

public void setPositionalParameterTypes(Type[] types)

setPositionalParameterValues

public void setPositionalParameterValues(Object[] objects)

setRowSelection

public void setRowSelection(RowSelection selection)

getLockOptions

public LockOptions getLockOptions()

setLockOptions

public void setLockOptions(LockOptions lockOptions)

traceParameters

public void traceParameters(SessionFactoryImplementor factory)
                     throws HibernateException
Throws:
HibernateException

isCacheable

public boolean isCacheable()

setCacheable

public void setCacheable(boolean b)

getCacheRegion

public String getCacheRegion()

setCacheRegion

public void setCacheRegion(String cacheRegion)

validateParameters

public void validateParameters()
                        throws QueryException
Throws:
QueryException

getComment

public String getComment()

setComment

public void setComment(String comment)

getScrollMode

public ScrollMode getScrollMode()

setScrollMode

public void setScrollMode(ScrollMode scrollMode)

getCollectionKeys

public Serializable[] getCollectionKeys()

setCollectionKeys

public void setCollectionKeys(Serializable[] collectionKeys)

getOptionalEntityName

public String getOptionalEntityName()

setOptionalEntityName

public void setOptionalEntityName(String optionalEntityName)

getOptionalId

public Serializable getOptionalId()

setOptionalId

public void setOptionalId(Serializable optionalId)

getOptionalObject

public Object getOptionalObject()

setOptionalObject

public void setOptionalObject(Object optionalObject)

isReadOnlyInitialized

public boolean isReadOnlyInitialized()
Has the read-only/modifiable mode been explicitly set?

Returns:
true, the read-only/modifiable mode was explicitly set false, the read-only/modifiable mode was not explicitly set
See Also:
setReadOnly(boolean), isReadOnly(SessionImplementor)

isReadOnly

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:
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
Throws:
IllegalStateException - if the read-only/modifiable setting has not been initialized (i.e., isReadOnlyInitialized() == false).
See Also:
isReadOnlyInitialized(), isReadOnly(SessionImplementor), 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.

isReadOnly

public boolean isReadOnly(SessionImplementor 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.

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
See Also:
isReadOnlyInitialized(), 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.

setReadOnly

public void setReadOnly(boolean readOnly)
Set the read-only/modifiable mode for entities and proxies loaded by the query. *

See Also:
isReadOnlyInitialized(), isReadOnly(SessionImplementor), 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.

setCallable

public void setCallable(boolean callable)

isCallable

public boolean isCallable()

hasAutoDiscoverScalarTypes

public boolean hasAutoDiscoverScalarTypes()

processFilters

public void processFilters(String sql,
                           SessionImplementor session)

processFilters

public void processFilters(String sql,
                           Map filters,
                           SessionFactoryImplementor factory)

getFilteredSQL

public String getFilteredSQL()

getFilteredPositionalParameterValues

public Object[] getFilteredPositionalParameterValues()

getFilteredPositionalParameterTypes

public Type[] getFilteredPositionalParameterTypes()

isNaturalKeyLookup

public boolean isNaturalKeyLookup()

setNaturalKeyLookup

public void setNaturalKeyLookup(boolean isNaturalKeyLookup)

setAutoDiscoverScalarTypes

public void setAutoDiscoverScalarTypes(boolean autodiscovertypes)

createCopyUsing

public QueryParameters createCopyUsing(RowSelection selection)


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