public class QueryImpl<X> extends AbstractQueryImpl<X> implements TypedQuery<X>, HibernateQuery
Query and TypedQuery contracts.| Modifier and Type | Field and Description |
|---|---|
static EntityManagerMessageLogger |
LOG |
| Constructor and Description |
|---|
QueryImpl(Query query,
AbstractEntityManagerImpl em) |
QueryImpl(Query query,
AbstractEntityManagerImpl em,
Map<String,Class> namedParameterTypeRedefinitions) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyAliasSpecificLockMode(String alias,
LockMode lockMode) |
protected void |
applyCacheable(boolean isCacheable) |
protected void |
applyCacheMode(CacheMode cacheMode) |
protected void |
applyCacheRegion(String regionName) |
protected void |
applyComment(String comment) |
protected void |
applyFetchSize(int fetchSize) |
protected void |
applyFirstResult(int firstResult)
Apply the given first-result value.
|
protected void |
applyFlushMode(FlushMode flushMode) |
protected void |
applyMaxResults(int maxResults)
Apply the given max results value.
|
protected void |
applyReadOnly(boolean isReadOnly) |
protected void |
applyTimeout(int timeout) |
protected boolean |
canApplyLockModes() |
Query |
getHibernateQuery() |
LockModeType |
getLockMode()
Get the current lock mode for the query.
|
Parameter<?> |
getParameter(int position)
Get the parameter object corresponding to the declared
positional parameter with the given position.
|
<T> Parameter<T> |
getParameter(int position,
Class<T> type)
Get the parameter object corresponding to the declared
positional parameter with the given position and type.
|
Parameter<?> |
getParameter(String name)
Get the parameter object corresponding to the declared
parameter of the given name.
|
<T> Parameter<T> |
getParameter(String name,
Class<T> type)
Get the parameter object corresponding to the declared
parameter of the given name and type.
|
Set<Parameter<?>> |
getParameters()
Get the parameter objects corresponding to the declared
parameters of the query.
|
List<X> |
getResultList()
Execute a SELECT query and return the query results
as a typed List.
|
X |
getSingleResult()
Execute a SELECT query that returns a single result.
|
protected int |
internalExecuteUpdate()
Actually execute the update; all pre-requisites have been checked.
|
TypedQuery<X> |
setLockMode(LockModeType lockModeType)
Set the lock mode type to be used for the query execution.
|
TypedQuery<X> |
setParameter(int position,
Calendar value,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a positional
parameter. |
TypedQuery<X> |
setParameter(int position,
Date value,
TemporalType temporalType)
Bind an instance of
java.util.Date to a positional parameter. |
TypedQuery<X> |
setParameter(int position,
Object value)
Bind an argument to a positional parameter.
|
TypedQuery<X> |
setParameter(Parameter<Calendar> param,
Calendar value,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a Parameter object. |
TypedQuery<X> |
setParameter(Parameter<Date> param,
Date value,
TemporalType temporalType)
Bind an instance of
java.util.Date to a Parameter object. |
<T> TypedQuery<X> |
setParameter(Parameter<T> param,
T value)
Bind the value of a
Parameter object. |
TypedQuery<X> |
setParameter(String name,
Calendar value,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a named parameter. |
TypedQuery<X> |
setParameter(String name,
Date value,
TemporalType temporalType)
Bind an instance of
java.util.Date to a named parameter. |
TypedQuery<X> |
setParameter(String name,
Object value)
Bind an argument to a named parameter.
|
<T> T |
unwrap(Class<T> tClass)
Return an object of the specified type to allow access to
the provider-specific API.
|
executeUpdate, getEntityManager, getFirstResult, getFlushMode, getHints, getMaxResults, getParameterValue, getParameterValue, getParameterValue, getSpecifiedFlushMode, getSpecifiedMaxResults, getSupportedHints, isBound, registerParameterBinding, setFirstResult, setFlushMode, setHint, setMaxResultsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetFirstResult, setFlushMode, setHint, setMaxResultsexecuteUpdate, getFirstResult, getFlushMode, getHints, getMaxResults, getParameterValue, getParameterValue, getParameterValue, isBoundpublic static final EntityManagerMessageLogger LOG
public QueryImpl(Query query, AbstractEntityManagerImpl em)
public QueryImpl(Query query, AbstractEntityManagerImpl em, Map<String,Class> namedParameterTypeRedefinitions)
public Query getHibernateQuery()
getHibernateQuery in interface HibernateQueryprotected int internalExecuteUpdate()
AbstractQueryImplinternalExecuteUpdate in class AbstractQueryImpl<X>protected void applyMaxResults(int maxResults)
AbstractQueryImplapplyMaxResults in class AbstractQueryImpl<X>maxResults - The specified max resultsprotected void applyFirstResult(int firstResult)
AbstractQueryImplapplyFirstResult in class AbstractQueryImpl<X>firstResult - The specified first-result value.protected void applyTimeout(int timeout)
applyTimeout in class AbstractQueryImpl<X>protected void applyComment(String comment)
applyComment in class AbstractQueryImpl<X>protected void applyFetchSize(int fetchSize)
applyFetchSize in class AbstractQueryImpl<X>protected void applyCacheable(boolean isCacheable)
applyCacheable in class AbstractQueryImpl<X>protected void applyCacheRegion(String regionName)
applyCacheRegion in class AbstractQueryImpl<X>protected void applyReadOnly(boolean isReadOnly)
applyReadOnly in class AbstractQueryImpl<X>protected void applyCacheMode(CacheMode cacheMode)
applyCacheMode in class AbstractQueryImpl<X>protected void applyFlushMode(FlushMode flushMode)
applyFlushMode in class AbstractQueryImpl<X>protected boolean canApplyLockModes()
canApplyLockModes in class AbstractQueryImpl<X>protected void applyAliasSpecificLockMode(String alias, LockMode lockMode)
applyAliasSpecificLockMode in class AbstractQueryImpl<X>public List<X> getResultList()
getResultList in interface QuerygetResultList in interface TypedQuery<X>public X getSingleResult()
getSingleResult in interface QuerygetSingleResult in interface TypedQuery<X>public <T> TypedQuery<X> setParameter(Parameter<T> param, T value)
TypedQueryParameter object.setParameter in interface QuerysetParameter in interface TypedQuery<X>param - parameter objectvalue - parameter valuepublic TypedQuery<X> setParameter(Parameter<Date> param, Date value, TemporalType temporalType)
TypedQueryjava.util.Date to a Parameter object.setParameter in interface QuerysetParameter in interface TypedQuery<X>param - parameter objectvalue - parameter valuetemporalType - temporal typepublic TypedQuery<X> setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)
TypedQueryjava.util.Calendar to a Parameter object.setParameter in interface QuerysetParameter in interface TypedQuery<X>param - parameter objectvalue - parameter valuetemporalType - temporal typepublic TypedQuery<X> setParameter(String name, Object value)
setParameter in interface QuerysetParameter in interface TypedQuery<X>name - parameter namevalue - parameter valuepublic TypedQuery<X> setParameter(String name, Date value, TemporalType temporalType)
java.util.Date to a named parameter.setParameter in interface QuerysetParameter in interface TypedQuery<X>name - parameter namevalue - parameter valuetemporalType - temporal typepublic TypedQuery<X> setParameter(String name, Calendar value, TemporalType temporalType)
java.util.Calendar to a named parameter.setParameter in interface QuerysetParameter in interface TypedQuery<X>name - parameter namevalue - parameter valuetemporalType - temporal typepublic TypedQuery<X> setParameter(int position, Object value)
setParameter in interface QuerysetParameter in interface TypedQuery<X>position - positionvalue - parameter valuepublic TypedQuery<X> setParameter(int position, Date value, TemporalType temporalType)
java.util.Date to a positional parameter.setParameter in interface QuerysetParameter in interface TypedQuery<X>position - positionvalue - parameter valuetemporalType - temporal typepublic TypedQuery<X> setParameter(int position, Calendar value, TemporalType temporalType)
java.util.Calendar to a positional
parameter.setParameter in interface QuerysetParameter in interface TypedQuery<X>position - positionvalue - parameter valuetemporalType - temporal typepublic Set<Parameter<?>> getParameters()
getParameters in interface Querypublic Parameter<?> getParameter(String name)
getParameter in interface Queryname - parameter namepublic Parameter<?> getParameter(int position)
getParameter in interface Queryposition - positionpublic <T> Parameter<T> getParameter(String name, Class<T> type)
getParameter in interface Queryname - parameter nametype - typepublic <T> Parameter<T> getParameter(int position, Class<T> type)
getParameter in interface Queryposition - positiontype - typepublic <T> T unwrap(Class<T> tClass)
PersistenceException is thrown.public TypedQuery<X> setLockMode(LockModeType lockModeType)
TypedQuerysetLockMode in interface QuerysetLockMode in interface TypedQuery<X>setLockMode in class AbstractQueryImpl<X>lockModeType - lock modepublic LockModeType getLockMode()
QuerygetLockMode in interface QuerygetLockMode in class AbstractQueryImpl<X>Copyright © 2012 JBoss by Red Hat. All Rights Reserved.