public abstract class BaseQueryImpl extends Object implements Query
Query implementations, including
TypedQuery and StoredProcedureQuery. Care should be taken
that all changes here fit with all those usages.| Modifier and Type | Class and Description |
|---|---|
protected static class |
BaseQueryImpl.ParameterBindImpl<T> |
| Constructor and Description |
|---|
BaseQueryImpl(HibernateEntityManagerImplementor entityManager) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
applyAliasSpecificLockModeHint(String alias,
LockMode lockMode)
Apply the alias specific lock modes.
|
protected abstract boolean |
applyCacheableHint(boolean isCacheable)
Apply the cacheable (true/false) hint.
|
protected abstract boolean |
applyCacheModeHint(CacheMode cacheMode)
Apply the CacheMode hint.
|
protected abstract boolean |
applyCacheRegionHint(String regionName)
Apply the cache region hint
|
protected abstract boolean |
applyCommentHint(String comment)
Apply the comment hint.
|
protected abstract boolean |
applyFetchSizeHint(int fetchSize)
Apply the fetch size hint
|
protected abstract void |
applyFirstResult(int firstResult)
Apply the given first-result value.
|
protected abstract boolean |
applyFlushModeHint(FlushMode flushMode)
Apply the FlushMode hint.
|
protected abstract boolean |
applyLockTimeoutHint(int timeout)
Apply the lock timeout (in seconds!) hint
|
protected abstract void |
applyMaxResults(int maxResults)
Apply the given max results value.
|
protected abstract boolean |
applyReadOnlyHint(boolean isReadOnly)
Apply the read-only (true/false) hint.
|
protected abstract boolean |
applyTimeoutHint(int timeout)
Apply the query timeout hint.
|
protected abstract boolean |
canApplyAliasSpecificLockModeHints()
Can alias-specific lock modes be applied?
|
protected void |
checkOpen(boolean markForRollbackIfClosed) |
protected HibernateEntityManagerImplementor |
entityManager() |
protected <X> ParameterRegistration<X> |
findParameterRegistration(int parameterPosition) |
protected <X> ParameterRegistration<X> |
findParameterRegistration(Parameter<X> parameter) |
protected <X> ParameterRegistration<X> |
findParameterRegistration(String parameterName) |
protected EntityGraphQueryHint |
getEntityGraphQueryHint() |
int |
getFirstResult()
The position of the first result the query object was set to
retrieve.
|
FlushModeType |
getFlushMode()
Get the flush mode in effect for the query execution.
|
Map<String,Object> |
getHints()
Get the properties and hints and associated values that are
in effect for the query instance.
|
int |
getMaxResults()
The maximum number of results the query object was set to
retrieve.
|
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 |
getParameters()
Get the parameter objects corresponding to the declared
parameters of the query.
|
Object |
getParameterValue(int position)
Return the value bound to the positional parameter.
|
<T> T |
getParameterValue(Parameter<T> param)
Return the value bound to the parameter.
|
Object |
getParameterValue(String name)
Return the value bound to the named parameter.
|
protected FlushModeType |
getSpecifiedFlushMode() |
int |
getSpecifiedMaxResults() |
Set<String> |
getSupportedHints() |
protected abstract void |
internalApplyLockMode(LockModeType lockModeType) |
boolean |
isBound(Parameter<?> param)
Return a boolean indicating whether a value has been bound
to the parameter.
|
protected abstract boolean |
isNativeSqlQuery()
Is the query represented here a native SQL query?
|
protected abstract boolean |
isSelectQuery()
Is the query represented here a SELECT query?
|
protected void |
registerParameter(ParameterRegistration parameter) |
BaseQueryImpl |
setFirstResult(int firstResult)
Set the position of the first result to retrieve.
|
BaseQueryImpl |
setFlushMode(FlushModeType jpaFlushMode)
Set the flush mode type to be used for the query execution.
|
BaseQueryImpl |
setHint(String hintName,
Object value)
Set a query property or hint.
|
BaseQueryImpl |
setMaxResults(int maxResult)
Set the maximum number of results to retrieve.
|
BaseQueryImpl |
setParameter(int position,
Calendar value,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a positional
parameter. |
BaseQueryImpl |
setParameter(int position,
Date value,
TemporalType temporalType)
Bind an instance of
java.util.Date to a positional parameter. |
BaseQueryImpl |
setParameter(int position,
Object value)
Bind an argument to a positional parameter.
|
BaseQueryImpl |
setParameter(Parameter<Calendar> param,
Calendar value,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a Parameter object. |
BaseQueryImpl |
setParameter(Parameter<Date> param,
Date value,
TemporalType temporalType)
Bind an instance of
java.util.Date to a Parameter object. |
<T> BaseQueryImpl |
setParameter(Parameter<T> param,
T value)
Bind the value of a
Parameter object. |
BaseQueryImpl |
setParameter(String name,
Calendar value,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a named parameter. |
BaseQueryImpl |
setParameter(String name,
Date value,
TemporalType temporalType)
Bind an instance of
java.util.Date to a named parameter. |
BaseQueryImpl |
setParameter(String name,
Object value)
Bind an argument to a named parameter.
|
protected static void |
validateBinding(Class parameterType,
Object bind,
TemporalType temporalType) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexecuteUpdate, getLockMode, getResultList, getSingleResult, setLockMode, unwrappublic BaseQueryImpl(HibernateEntityManagerImplementor entityManager)
protected HibernateEntityManagerImplementor entityManager()
protected void checkOpen(boolean markForRollbackIfClosed)
protected abstract void applyFirstResult(int firstResult)
firstResult - The specified first-result value.public BaseQueryImpl setFirstResult(int firstResult)
QuerysetFirstResult in interface QueryfirstResult - position of the first result,
numbered from 0public int getFirstResult()
QuerysetFirstResult was not applied to the
query object.getFirstResult in interface Queryprotected abstract void applyMaxResults(int maxResults)
maxResults - The specified max resultspublic BaseQueryImpl setMaxResults(int maxResult)
QuerysetMaxResults in interface QuerymaxResult - maximum number of results to retrievepublic int getSpecifiedMaxResults()
public int getMaxResults()
QueryInteger.MAX_VALUE if setMaxResults was not
applied to the query object.getMaxResults in interface Querypublic Map<String,Object> getHints()
Queryprotected abstract boolean applyTimeoutHint(int timeout)
timeout - The timeout (in seconds!) specified as a hinttrue if the hint was "applied"protected abstract boolean applyLockTimeoutHint(int timeout)
timeout - The timeout (in seconds!) specified as a hinttrue if the hint was "applied"protected abstract boolean applyCommentHint(String comment)
comment - The comment specified as a hinttrue if the hint was "applied"protected abstract boolean applyFetchSizeHint(int fetchSize)
fetchSize - The fetch size specified as a hinttrue if the hint was "applied"protected abstract boolean applyCacheableHint(boolean isCacheable)
isCacheable - The value specified as hinttrue if the hint was "applied"protected abstract boolean applyCacheRegionHint(String regionName)
regionName - The name of the cache region specified as a hinttrue if the hint was "applied"protected abstract boolean applyReadOnlyHint(boolean isReadOnly)
isReadOnly - The value specified as hinttrue if the hint was "applied"protected abstract boolean applyCacheModeHint(CacheMode cacheMode)
cacheMode - The CacheMode value specified as a hint.true if the hint was "applied"protected abstract boolean applyFlushModeHint(FlushMode flushMode)
flushMode - The FlushMode value specified as hinttrue if the hint was "applied"protected abstract boolean canApplyAliasSpecificLockModeHints()
true indicates they can be applied, false otherwise.protected abstract void applyAliasSpecificLockModeHint(String alias, LockMode lockMode)
canApplyAliasSpecificLockModeHints() has already been
called and returned true.alias - The alias to apply the 'lockMode' to.lockMode - The LockMode to apply.public BaseQueryImpl setHint(String hintName, Object value)
Queryprotected abstract boolean isNativeSqlQuery()
true if it is a native SQL query; false otherwiseprotected abstract boolean isSelectQuery()
true if the query is a SELECT; false otherwise.protected abstract void internalApplyLockMode(LockModeType lockModeType)
public BaseQueryImpl setFlushMode(FlushModeType jpaFlushMode)
QuerysetFlushMode in interface QueryjpaFlushMode - flush modeprotected FlushModeType getSpecifiedFlushMode()
public FlushModeType getFlushMode()
QuerygetFlushMode in interface Queryprotected <X> ParameterRegistration<X> findParameterRegistration(Parameter<X> parameter)
protected <X> ParameterRegistration<X> findParameterRegistration(String parameterName)
protected <X> ParameterRegistration<X> findParameterRegistration(int parameterPosition)
protected void registerParameter(ParameterRegistration parameter)
public <T> BaseQueryImpl setParameter(Parameter<T> param, T value)
QueryParameter object.setParameter in interface Queryparam - parameter objectvalue - parameter valuepublic BaseQueryImpl setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)
Queryjava.util.Calendar to a Parameter object.setParameter in interface Queryparam - parameter objectvalue - parameter valuetemporalType - temporal typepublic BaseQueryImpl setParameter(Parameter<Date> param, Date value, TemporalType temporalType)
Queryjava.util.Date to a Parameter object.setParameter in interface Queryparam - parameter objectvalue - parameter valuetemporalType - temporal typepublic BaseQueryImpl setParameter(String name, Object value)
QuerysetParameter in interface Queryname - parameter namevalue - parameter valuepublic BaseQueryImpl setParameter(String name, Calendar value, TemporalType temporalType)
Queryjava.util.Calendar to a named parameter.setParameter in interface Queryname - parameter namevalue - parameter valuetemporalType - temporal typepublic BaseQueryImpl setParameter(String name, Date value, TemporalType temporalType)
Queryjava.util.Date to a named parameter.setParameter in interface Queryname - parameter namevalue - parameter valuetemporalType - temporal typepublic BaseQueryImpl setParameter(int position, Object value)
QuerysetParameter in interface Queryposition - positionvalue - parameter valuepublic BaseQueryImpl setParameter(int position, Calendar value, TemporalType temporalType)
Queryjava.util.Calendar to a positional
parameter.setParameter in interface Queryposition - positionvalue - parameter valuetemporalType - temporal typepublic BaseQueryImpl setParameter(int position, Date value, TemporalType temporalType)
Queryjava.util.Date to a positional parameter.setParameter in interface Queryposition - positionvalue - parameter valuetemporalType - temporal typepublic Set getParameters()
QuerygetParameters in interface Querypublic Parameter<?> getParameter(String name)
QuerygetParameter in interface Queryname - parameter namepublic <T> Parameter<T> getParameter(String name, Class<T> type)
QuerygetParameter in interface Queryname - parameter nametype - typepublic Parameter<?> getParameter(int position)
QuerygetParameter in interface Queryposition - positionpublic <T> Parameter<T> getParameter(int position, Class<T> type)
QuerygetParameter in interface Queryposition - positiontype - typepublic boolean isBound(Parameter<?> param)
Querypublic <T> T getParameterValue(Parameter<T> param)
QuerygetParameterValue in interface Queryparam - parameter objectpublic Object getParameterValue(String name)
QuerygetParameterValue in interface Queryname - parameter namepublic Object getParameterValue(int position)
QuerygetParameterValue in interface Queryposition - positionprotected EntityGraphQueryHint getEntityGraphQueryHint()
protected static void validateBinding(Class parameterType, Object bind, TemporalType temporalType)
Copyright © 2017 JBoss by Red Hat. All rights reserved.