public abstract class AbstractQueryImpl<X> extends Object implements TypedQuery<X>
Query
and
TypedQuery
.
IMPL NOTE : This issue, and the reason for this distinction, is that criteria and hl.sql queries share no
commonality currently in Hibernate internals.Constructor and Description |
---|
AbstractQueryImpl(HibernateEntityManagerImplementor entityManager) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
applyAliasSpecificLockMode(String alias,
LockMode lockMode) |
protected abstract void |
applyCacheable(boolean isCacheable) |
protected abstract void |
applyCacheMode(CacheMode cacheMode) |
protected abstract void |
applyCacheRegion(String regionName) |
protected abstract void |
applyComment(String comment) |
protected abstract void |
applyFetchSize(int fetchSize) |
protected abstract void |
applyFirstResult(int firstResult)
Apply the given first-result value.
|
protected abstract void |
applyFlushMode(FlushMode flushMode) |
protected abstract void |
applyMaxResults(int maxResults)
Apply the given max results value.
|
protected abstract void |
applyReadOnly(boolean isReadOnly) |
protected abstract void |
applyTimeout(int timeout) |
protected abstract boolean |
canApplyLockModes() |
int |
executeUpdate()
Execute an update or delete statement.
|
protected HibernateEntityManagerImplementor |
getEntityManager() |
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.
|
abstract LockModeType |
getLockMode()
Get the current lock mode for the query.
|
int |
getMaxResults()
The maximum number of results the query object was set to
retrieve.
|
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 int |
internalExecuteUpdate()
Actually execute the update; all pre-requisites have been checked.
|
boolean |
isBound(Parameter<?> param)
Return a boolean indicating whether a value has been bound
to the parameter.
|
protected void |
registerParameterBinding(Parameter parameter,
Object value) |
TypedQuery<X> |
setFirstResult(int firstResult)
Set the position of the first result to retrieve.
|
TypedQuery<X> |
setFlushMode(FlushModeType jpaFlushMode)
Set the flush mode type to be used for the query execution.
|
TypedQuery<X> |
setHint(String hintName,
Object value)
Set a query property or hint.
|
abstract TypedQuery<X> |
setLockMode(LockModeType lockModeType)
Set the lock mode type to be used for the query execution.
|
TypedQuery<X> |
setMaxResults(int maxResult)
Set the maximum number of results to retrieve.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getResultList, getSingleResult, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter
getParameter, getParameter, getParameter, getParameter, getParameters, unwrap
public AbstractQueryImpl(HibernateEntityManagerImplementor entityManager)
protected HibernateEntityManagerImplementor getEntityManager()
protected abstract int internalExecuteUpdate()
public int executeUpdate()
Query
executeUpdate
in interface Query
protected abstract void applyMaxResults(int maxResults)
maxResults
- The specified max resultspublic TypedQuery<X> setMaxResults(int maxResult)
TypedQuery
setMaxResults
in interface Query
setMaxResults
in interface TypedQuery<X>
maxResult
- maximum number of results to retrievepublic int getSpecifiedMaxResults()
public int getMaxResults()
Query
Integer.MAX_VALUE
if setMaxResults
was not
applied to the query object.getMaxResults
in interface Query
protected abstract void applyFirstResult(int firstResult)
firstResult
- The specified first-result value.public TypedQuery<X> setFirstResult(int firstResult)
TypedQuery
setFirstResult
in interface Query
setFirstResult
in interface TypedQuery<X>
firstResult
- position of the first result,
numbered from 0public int getFirstResult()
Query
setFirstResult
was not applied to the
query object.getFirstResult
in interface Query
public Map<String,Object> getHints()
Query
protected abstract void applyTimeout(int timeout)
protected abstract void applyComment(String comment)
protected abstract void applyFetchSize(int fetchSize)
protected abstract void applyCacheable(boolean isCacheable)
protected abstract void applyCacheRegion(String regionName)
protected abstract void applyReadOnly(boolean isReadOnly)
protected abstract void applyCacheMode(CacheMode cacheMode)
protected abstract void applyFlushMode(FlushMode flushMode)
protected abstract boolean canApplyLockModes()
protected abstract void applyAliasSpecificLockMode(String alias, LockMode lockMode)
public TypedQuery<X> setHint(String hintName, Object value)
TypedQuery
setHint
in interface Query
setHint
in interface TypedQuery<X>
hintName
- name of property or hintvalue
- value for the property or hintpublic abstract TypedQuery<X> setLockMode(LockModeType lockModeType)
TypedQuery
setLockMode
in interface Query
setLockMode
in interface TypedQuery<X>
lockModeType
- lock modepublic abstract LockModeType getLockMode()
Query
getLockMode
in interface Query
public TypedQuery<X> setFlushMode(FlushModeType jpaFlushMode)
TypedQuery
setFlushMode
in interface Query
setFlushMode
in interface TypedQuery<X>
jpaFlushMode
- flush modeprotected FlushModeType getSpecifiedFlushMode()
public FlushModeType getFlushMode()
Query
getFlushMode
in interface Query
public boolean isBound(Parameter<?> param)
Query
public <T> T getParameterValue(Parameter<T> param)
Query
getParameterValue
in interface Query
param
- parameter objectpublic Object getParameterValue(String name)
Query
getParameterValue
in interface Query
name
- parameter namepublic Object getParameterValue(int position)
Query
getParameterValue
in interface Query
position
- positionCopyright © 2012 JBoss by Red Hat. All Rights Reserved.