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() |
FlushModeType |
getFlushMode() |
Map<String,Object> |
getHints() |
int |
getMaxResults() |
Parameter<?> |
getParameter(int position) |
<T> Parameter<T> |
getParameter(int position,
Class<T> type) |
Parameter<?> |
getParameter(String name) |
<T> Parameter<T> |
getParameter(String name,
Class<T> type) |
Set |
getParameters() |
Object |
getParameterValue(int position) |
<T> T |
getParameterValue(Parameter<T> param) |
Object |
getParameterValue(String name) |
protected FlushModeType |
getSpecifiedFlushMode() |
int |
getSpecifiedMaxResults() |
Set<String> |
getSupportedHints() |
protected abstract void |
internalApplyLockMode(LockModeType lockModeType) |
boolean |
isBound(Parameter<?> param) |
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) |
BaseQueryImpl |
setFlushMode(FlushModeType jpaFlushMode) |
BaseQueryImpl |
setHint(String hintName,
Object value) |
BaseQueryImpl |
setMaxResults(int maxResult) |
BaseQueryImpl |
setParameter(int position,
Calendar value,
TemporalType temporalType) |
BaseQueryImpl |
setParameter(int position,
Date value,
TemporalType temporalType) |
BaseQueryImpl |
setParameter(int position,
Object value) |
BaseQueryImpl |
setParameter(Parameter<Calendar> param,
Calendar value,
TemporalType temporalType) |
BaseQueryImpl |
setParameter(Parameter<Date> param,
Date value,
TemporalType temporalType) |
<T> BaseQueryImpl |
setParameter(Parameter<T> param,
T value) |
BaseQueryImpl |
setParameter(String name,
Calendar value,
TemporalType temporalType) |
BaseQueryImpl |
setParameter(String name,
Date value,
TemporalType temporalType) |
BaseQueryImpl |
setParameter(String name,
Object value) |
protected static void |
validateBinding(Class parameterType,
Object bind,
TemporalType temporalType) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeUpdate, getLockMode, getResultList, getSingleResult, setLockMode, unwrap
public 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)
setFirstResult
in interface Query
public int getFirstResult()
getFirstResult
in interface Query
protected abstract void applyMaxResults(int maxResults)
maxResults
- The specified max resultspublic BaseQueryImpl setMaxResults(int maxResult)
setMaxResults
in interface Query
public int getSpecifiedMaxResults()
public int getMaxResults()
getMaxResults
in interface Query
protected 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)
protected 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)
setFlushMode
in interface Query
protected FlushModeType getSpecifiedFlushMode()
public FlushModeType getFlushMode()
getFlushMode
in interface Query
protected <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)
setParameter
in interface Query
public BaseQueryImpl setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)
setParameter
in interface Query
public BaseQueryImpl setParameter(Parameter<Date> param, Date value, TemporalType temporalType)
setParameter
in interface Query
public BaseQueryImpl setParameter(String name, Object value)
setParameter
in interface Query
public BaseQueryImpl setParameter(String name, Calendar value, TemporalType temporalType)
setParameter
in interface Query
public BaseQueryImpl setParameter(String name, Date value, TemporalType temporalType)
setParameter
in interface Query
public BaseQueryImpl setParameter(int position, Object value)
setParameter
in interface Query
public BaseQueryImpl setParameter(int position, Calendar value, TemporalType temporalType)
setParameter
in interface Query
public BaseQueryImpl setParameter(int position, Date value, TemporalType temporalType)
setParameter
in interface Query
public Set getParameters()
getParameters
in interface Query
public Parameter<?> getParameter(String name)
getParameter
in interface Query
public <T> Parameter<T> getParameter(String name, Class<T> type)
getParameter
in interface Query
public Parameter<?> getParameter(int position)
getParameter
in interface Query
public <T> Parameter<T> getParameter(int position, Class<T> type)
getParameter
in interface Query
public <T> T getParameterValue(Parameter<T> param)
getParameterValue
in interface Query
public Object getParameterValue(String name)
getParameterValue
in interface Query
public Object getParameterValue(int position)
getParameterValue
in interface Query
protected EntityGraphQueryHint getEntityGraphQueryHint()
protected static void validateBinding(Class parameterType, Object bind, TemporalType temporalType)
Copyright © 2001-2017 Red Hat, Inc. All Rights Reserved.