public abstract class AbstractQueryImpl<X> extends BaseQueryImpl implements TypedQuery<X>
Query
and TypedQuery
, including
query references built from criteria queries.
Not intended as base for StoredProcedureQuery
BaseQueryImpl.ParameterBindImpl<T>
Constructor and Description |
---|
AbstractQueryImpl(HibernateEntityManagerImplementor entityManager) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkTransaction() |
int |
executeUpdate()
Execute an update or delete statement.
|
protected HibernateEntityManagerImplementor |
getEntityManager() |
LockModeType |
getLockMode()
Get the current lock mode for the query.
|
Set<String> |
getSupportedHints() |
protected abstract int |
internalExecuteUpdate()
Actually execute the update; all pre-requisites have been checked.
|
AbstractQueryImpl<X> |
setFirstResult(int firstResult)
Set the position of the first result to retrieve.
|
AbstractQueryImpl<X> |
setFlushMode(FlushModeType jpaFlushMode)
Set the flush mode type to be used for the query execution.
|
AbstractQueryImpl<X> |
setHint(String hintName,
Object value)
Set a query property or hint.
|
TypedQuery<X> |
setLockMode(LockModeType lockModeType)
Set the lock mode type to be used for the query execution.
|
AbstractQueryImpl<X> |
setMaxResults(int maxResults)
Set the maximum number of results to retrieve.
|
AbstractQueryImpl<X> |
setParameter(int position,
Calendar value,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a positional
parameter. |
AbstractQueryImpl<X> |
setParameter(int position,
Date value,
TemporalType temporalType)
Bind an instance of
java.util.Date to a positional parameter. |
AbstractQueryImpl<X> |
setParameter(int position,
Object value)
Bind an argument to a positional parameter.
|
AbstractQueryImpl<X> |
setParameter(Parameter<Calendar> param,
Calendar value,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a Parameter object. |
AbstractQueryImpl<X> |
setParameter(Parameter<Date> param,
Date value,
TemporalType temporalType)
Bind an instance of
java.util.Date to a Parameter object. |
<T> AbstractQueryImpl<X> |
setParameter(Parameter<T> param,
T value)
Bind the value of a
Parameter object. |
AbstractQueryImpl<X> |
setParameter(String name,
Calendar value,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a named parameter. |
AbstractQueryImpl<X> |
setParameter(String name,
Date value,
TemporalType temporalType)
Bind an instance of
java.util.Date to a named parameter. |
AbstractQueryImpl<X> |
setParameter(String name,
Object value)
Bind an argument to a named parameter.
|
applyAliasSpecificLockModeHint, applyCacheableHint, applyCacheModeHint, applyCacheRegionHint, applyCommentHint, applyFetchSizeHint, applyFirstResult, applyFlushModeHint, applyLockTimeoutHint, applyMaxResults, applyReadOnlyHint, applyTimeoutHint, canApplyAliasSpecificLockModeHints, checkOpen, entityManager, findParameterRegistration, findParameterRegistration, findParameterRegistration, getEntityGraphQueryHint, getFirstResult, getFlushMode, getHints, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, getSpecifiedFlushMode, getSpecifiedMaxResults, internalApplyLockMode, isBound, isNativeSqlQuery, isSelectQuery, registerParameter, validateBinding
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getResultList, getSingleResult
getFirstResult, getFlushMode, getHints, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, isBound, unwrap
public AbstractQueryImpl(HibernateEntityManagerImplementor entityManager)
protected HibernateEntityManagerImplementor getEntityManager()
protected abstract int internalExecuteUpdate()
public int executeUpdate()
Query
executeUpdate
in interface Query
public AbstractQueryImpl<X> setMaxResults(int maxResults)
Query
setMaxResults
in interface Query
setMaxResults
in interface TypedQuery<X>
setMaxResults
in class BaseQueryImpl
maxResults
- maximum number of results to retrievepublic AbstractQueryImpl<X> setFirstResult(int firstResult)
Query
setFirstResult
in interface Query
setFirstResult
in interface TypedQuery<X>
setFirstResult
in class BaseQueryImpl
firstResult
- position of the first result,
numbered from 0public AbstractQueryImpl<X> setHint(String hintName, Object value)
Query
setHint
in interface Query
setHint
in interface TypedQuery<X>
setHint
in class BaseQueryImpl
hintName
- name of the property or hintvalue
- value for the property or hintpublic Set<String> getSupportedHints()
getSupportedHints
in class BaseQueryImpl
public TypedQuery<X> setLockMode(LockModeType lockModeType)
TypedQuery
setLockMode
in interface Query
setLockMode
in interface TypedQuery<X>
lockModeType
- lock modepublic LockModeType getLockMode()
Query
getLockMode
in interface Query
public <T> AbstractQueryImpl<X> setParameter(Parameter<T> param, T value)
Query
Parameter
object.setParameter
in interface Query
setParameter
in interface TypedQuery<X>
setParameter
in class BaseQueryImpl
param
- parameter objectvalue
- parameter valuepublic AbstractQueryImpl<X> setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)
Query
java.util.Calendar
to a Parameter
object.setParameter
in interface Query
setParameter
in interface TypedQuery<X>
setParameter
in class BaseQueryImpl
param
- parameter objectvalue
- parameter valuetemporalType
- temporal typepublic AbstractQueryImpl<X> setParameter(Parameter<Date> param, Date value, TemporalType temporalType)
Query
java.util.Date
to a Parameter
object.setParameter
in interface Query
setParameter
in interface TypedQuery<X>
setParameter
in class BaseQueryImpl
param
- parameter objectvalue
- parameter valuetemporalType
- temporal typepublic AbstractQueryImpl<X> setParameter(String name, Object value)
Query
setParameter
in interface Query
setParameter
in interface TypedQuery<X>
setParameter
in class BaseQueryImpl
name
- parameter namevalue
- parameter valuepublic AbstractQueryImpl<X> setParameter(String name, Calendar value, TemporalType temporalType)
Query
java.util.Calendar
to a named parameter.setParameter
in interface Query
setParameter
in interface TypedQuery<X>
setParameter
in class BaseQueryImpl
name
- parameter namevalue
- parameter valuetemporalType
- temporal typepublic AbstractQueryImpl<X> setParameter(String name, Date value, TemporalType temporalType)
Query
java.util.Date
to a named parameter.setParameter
in interface Query
setParameter
in interface TypedQuery<X>
setParameter
in class BaseQueryImpl
name
- parameter namevalue
- parameter valuetemporalType
- temporal typepublic AbstractQueryImpl<X> setParameter(int position, Object value)
Query
setParameter
in interface Query
setParameter
in interface TypedQuery<X>
setParameter
in class BaseQueryImpl
position
- positionvalue
- parameter valuepublic AbstractQueryImpl<X> setParameter(int position, Calendar value, TemporalType temporalType)
Query
java.util.Calendar
to a positional
parameter.setParameter
in interface Query
setParameter
in interface TypedQuery<X>
setParameter
in class BaseQueryImpl
position
- positionvalue
- parameter valuetemporalType
- temporal typepublic AbstractQueryImpl<X> setParameter(int position, Date value, TemporalType temporalType)
Query
java.util.Date
to a positional parameter.setParameter
in interface Query
setParameter
in interface TypedQuery<X>
setParameter
in class BaseQueryImpl
position
- positionvalue
- parameter valuetemporalType
- temporal typepublic AbstractQueryImpl<X> setFlushMode(FlushModeType jpaFlushMode)
Query
setFlushMode
in interface Query
setFlushMode
in interface TypedQuery<X>
setFlushMode
in class BaseQueryImpl
jpaFlushMode
- flush modeprotected void checkTransaction()
Copyright © 2017 JBoss by Red Hat. All rights reserved.