public class StoredProcedureQueryImpl extends BaseQueryImpl implements StoredProcedureQuery
BaseQueryImpl.ParameterBindImpl<T>| Constructor and Description |
|---|
StoredProcedureQueryImpl(ProcedureCall procedureCall,
HibernateEntityManagerImplementor entityManager) |
StoredProcedureQueryImpl(ProcedureCallMemento memento,
HibernateEntityManagerImplementor entityManager)
This form is used to build a StoredProcedureQueryImpl from a memento (usually from a NamedStoredProcedureQuery).
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyAliasSpecificLockModeHint(String alias,
LockMode lockMode)
Apply the alias specific lock modes.
|
protected boolean |
applyCacheableHint(boolean isCacheable)
Apply the cacheable (true/false) hint.
|
protected boolean |
applyCacheModeHint(CacheMode cacheMode)
Apply the CacheMode hint.
|
protected boolean |
applyCacheRegionHint(String regionName)
Apply the cache region hint
|
protected boolean |
applyCommentHint(String comment)
Apply the comment hint.
|
protected boolean |
applyFetchSizeHint(int fetchSize)
Apply the fetch size hint
|
protected void |
applyFirstResult(int firstResult)
Apply the given first-result value.
|
protected boolean |
applyFlushModeHint(FlushMode flushMode)
Apply the FlushMode hint.
|
protected boolean |
applyLockTimeoutHint(int timeout)
Apply the lock timeout (in seconds!) hint
|
protected void |
applyMaxResults(int maxResults)
Apply the given max results value.
|
protected boolean |
applyReadOnlyHint(boolean isReadOnly)
Apply the read-only (true/false) hint.
|
protected boolean |
applyTimeoutHint(int timeout)
Apply the query timeout hint.
|
protected boolean |
canApplyAliasSpecificLockModeHints()
Can alias-specific lock modes be applied?
|
boolean |
execute()
Return true if the first result corresponds to a result set,
and false if it is an update count or if there are no results
other than through INOUT and OUT parameters, if any.
|
int |
executeUpdate()
Execute an update or delete statement.
|
ProcedureCall |
getHibernateProcedureCall() |
LockModeType |
getLockMode()
Get the current lock mode for the query.
|
Object |
getOutputParameterValue(int position)
Retrieve a value passed back from the procedure through an
INOUT or OUT parameter.
|
Object |
getOutputParameterValue(String parameterName)
Retrieve a value passed back from the procedure through an
INOUT or OUT parameter.
|
List |
getResultList()
Execute a SELECT query and return the query results
as an untyped List.
|
Object |
getSingleResult()
Execute a SELECT query that returns a single untyped result.
|
int |
getUpdateCount()
Return the update count or -1 if there is no pending result
or if the next result is not an update count.
|
boolean |
hasMoreResults()
Return true if the next result corresponds to a result set,
and false if it is an update count or if there are no results
other than through INOUT and OUT parameters, if any.
|
protected void |
internalApplyLockMode(LockModeType lockModeType) |
protected boolean |
isNativeSqlQuery()
Is the query represented here a native SQL query?
|
protected boolean |
isSelectQuery()
Is the query represented here a SELECT query?
|
protected ProcedureOutputs |
outputs() |
StoredProcedureQuery |
registerStoredProcedureParameter(int position,
Class type,
ParameterMode mode)
Register a positional parameter.
|
StoredProcedureQuery |
registerStoredProcedureParameter(String parameterName,
Class type,
ParameterMode mode)
Register a named parameter.
|
StoredProcedureQueryImpl |
setFlushMode(FlushModeType jpaFlushMode)
Set the flush mode type to be used for the query execution.
|
StoredProcedureQueryImpl |
setHint(String hintName,
Object value)
Set a query property or hint.
|
Query |
setLockMode(LockModeType lockMode)
Set the lock mode type to be used for the query execution.
|
StoredProcedureQueryImpl |
setParameter(int position,
Calendar value,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a positional
parameter. |
StoredProcedureQueryImpl |
setParameter(int position,
Date value,
TemporalType temporalType)
Bind an instance of
java.util.Date to a positional parameter. |
StoredProcedureQueryImpl |
setParameter(int position,
Object value)
Bind an argument to a positional parameter.
|
StoredProcedureQueryImpl |
setParameter(Parameter<Calendar> param,
Calendar value,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a Parameter object. |
StoredProcedureQueryImpl |
setParameter(Parameter<Date> param,
Date value,
TemporalType temporalType)
Bind an instance of
java.util.Date to a Parameter object. |
<T> StoredProcedureQueryImpl |
setParameter(Parameter<T> param,
T value)
Bind the value of a
Parameter object. |
StoredProcedureQueryImpl |
setParameter(String name,
Calendar value,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a named parameter. |
StoredProcedureQueryImpl |
setParameter(String name,
Date value,
TemporalType temporalType)
Bind an instance of
java.util.Date to a named parameter. |
StoredProcedureQueryImpl |
setParameter(String name,
Object value)
Bind an argument to a named parameter.
|
<T> T |
unwrap(Class<T> cls)
Return an object of the specified type to allow access to
the provider-specific API.
|
checkOpen, entityManager, findParameterRegistration, findParameterRegistration, findParameterRegistration, getEntityGraphQueryHint, getFirstResult, getFlushMode, getHints, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, getSpecifiedFlushMode, getSpecifiedMaxResults, getSupportedHints, isBound, registerParameter, setFirstResult, setMaxResults, validateBindingclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFirstResult, getFlushMode, getHints, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, isBound, setFirstResult, setMaxResultspublic StoredProcedureQueryImpl(ProcedureCall procedureCall, HibernateEntityManagerImplementor entityManager)
public StoredProcedureQueryImpl(ProcedureCallMemento memento, HibernateEntityManagerImplementor entityManager)
memento - The mementoentityManager - The EntityManagerprotected boolean applyTimeoutHint(int timeout)
BaseQueryImplapplyTimeoutHint in class BaseQueryImpltimeout - The timeout (in seconds!) specified as a hinttrue if the hint was "applied"protected boolean applyCacheableHint(boolean isCacheable)
BaseQueryImplapplyCacheableHint in class BaseQueryImplisCacheable - The value specified as hinttrue if the hint was "applied"protected boolean applyCacheRegionHint(String regionName)
BaseQueryImplapplyCacheRegionHint in class BaseQueryImplregionName - The name of the cache region specified as a hinttrue if the hint was "applied"protected boolean applyReadOnlyHint(boolean isReadOnly)
BaseQueryImplapplyReadOnlyHint in class BaseQueryImplisReadOnly - The value specified as hinttrue if the hint was "applied"protected boolean applyCacheModeHint(CacheMode cacheMode)
BaseQueryImplapplyCacheModeHint in class BaseQueryImplcacheMode - The CacheMode value specified as a hint.true if the hint was "applied"protected boolean applyFlushModeHint(FlushMode flushMode)
BaseQueryImplapplyFlushModeHint in class BaseQueryImplflushMode - The FlushMode value specified as hinttrue if the hint was "applied"public StoredProcedureQuery registerStoredProcedureParameter(int position, Class type, ParameterMode mode)
StoredProcedureQueryregisterStoredProcedureParameter in interface StoredProcedureQueryposition - parameter positiontype - type of the parametermode - parameter modepublic StoredProcedureQuery registerStoredProcedureParameter(String parameterName, Class type, ParameterMode mode)
StoredProcedureQueryregisterStoredProcedureParameter in interface StoredProcedureQueryparameterName - name of the parameter as registered or
specified in metadatatype - type of the parametermode - parameter modepublic <T> StoredProcedureQueryImpl setParameter(Parameter<T> param, T value)
QueryParameter object.setParameter in interface QuerysetParameter in interface StoredProcedureQuerysetParameter in class BaseQueryImplparam - parameter objectvalue - parameter valuepublic StoredProcedureQueryImpl setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)
Queryjava.util.Calendar to a Parameter object.setParameter in interface QuerysetParameter in interface StoredProcedureQuerysetParameter in class BaseQueryImplparam - parameter objectvalue - parameter valuetemporalType - temporal typepublic StoredProcedureQueryImpl setParameter(Parameter<Date> param, Date value, TemporalType temporalType)
Queryjava.util.Date to a Parameter object.setParameter in interface QuerysetParameter in interface StoredProcedureQuerysetParameter in class BaseQueryImplparam - parameter objectvalue - parameter valuetemporalType - temporal typepublic StoredProcedureQueryImpl setParameter(String name, Object value)
QuerysetParameter in interface QuerysetParameter in interface StoredProcedureQuerysetParameter in class BaseQueryImplname - parameter namevalue - parameter valuepublic StoredProcedureQueryImpl setParameter(String name, Calendar value, TemporalType temporalType)
Queryjava.util.Calendar to a named parameter.setParameter in interface QuerysetParameter in interface StoredProcedureQuerysetParameter in class BaseQueryImplname - parameter namevalue - parameter valuetemporalType - temporal typepublic StoredProcedureQueryImpl setParameter(String name, Date value, TemporalType temporalType)
Queryjava.util.Date to a named parameter.setParameter in interface QuerysetParameter in interface StoredProcedureQuerysetParameter in class BaseQueryImplname - parameter namevalue - parameter valuetemporalType - temporal typepublic StoredProcedureQueryImpl setParameter(int position, Object value)
QuerysetParameter in interface QuerysetParameter in interface StoredProcedureQuerysetParameter in class BaseQueryImplposition - positionvalue - parameter valuepublic StoredProcedureQueryImpl setParameter(int position, Calendar value, TemporalType temporalType)
Queryjava.util.Calendar to a positional
parameter.setParameter in interface QuerysetParameter in interface StoredProcedureQuerysetParameter in class BaseQueryImplposition - positionvalue - parameter valuetemporalType - temporal typepublic StoredProcedureQueryImpl setParameter(int position, Date value, TemporalType temporalType)
Queryjava.util.Date to a positional parameter.setParameter in interface QuerysetParameter in interface StoredProcedureQuerysetParameter in class BaseQueryImplposition - positionvalue - parameter valuetemporalType - temporal typepublic StoredProcedureQueryImpl setFlushMode(FlushModeType jpaFlushMode)
QuerysetFlushMode in interface QuerysetFlushMode in interface StoredProcedureQuerysetFlushMode in class BaseQueryImpljpaFlushMode - flush modepublic StoredProcedureQueryImpl setHint(String hintName, Object value)
QuerysetHint in interface QuerysetHint in interface StoredProcedureQuerysetHint in class BaseQueryImplhintName - name of the property or hintvalue - value for the property or hintpublic boolean execute()
StoredProcedureQueryexecute in interface StoredProcedureQueryprotected ProcedureOutputs outputs()
public int executeUpdate()
QueryexecuteUpdate in interface Querypublic Object getOutputParameterValue(int position)
StoredProcedureQuerygetOutputParameterValue in interface StoredProcedureQueryposition - parameter positionpublic Object getOutputParameterValue(String parameterName)
StoredProcedureQuerygetOutputParameterValue in interface StoredProcedureQueryparameterName - name of the parameter as registered or
specified in metadatapublic boolean hasMoreResults()
StoredProcedureQueryhasMoreResults in interface StoredProcedureQuerypublic int getUpdateCount()
StoredProcedureQuerygetUpdateCount in interface StoredProcedureQuerypublic List getResultList()
QuerygetResultList in interface Querypublic Object getSingleResult()
QuerygetSingleResult in interface Querypublic <T> T unwrap(Class<T> cls)
QueryPersistenceException is thrown.protected boolean isNativeSqlQuery()
BaseQueryImplisNativeSqlQuery in class BaseQueryImpltrue if it is a native SQL query; false otherwiseprotected boolean isSelectQuery()
BaseQueryImplisSelectQuery in class BaseQueryImpltrue if the query is a SELECT; false otherwise.public Query setLockMode(LockModeType lockMode)
QuerysetLockMode in interface QuerylockMode - lock modepublic LockModeType getLockMode()
QuerygetLockMode in interface Queryprotected void internalApplyLockMode(LockModeType lockModeType)
internalApplyLockMode in class BaseQueryImplprotected void applyFirstResult(int firstResult)
BaseQueryImplapplyFirstResult in class BaseQueryImplfirstResult - The specified first-result value.protected void applyMaxResults(int maxResults)
BaseQueryImplapplyMaxResults in class BaseQueryImplmaxResults - The specified max resultsprotected boolean canApplyAliasSpecificLockModeHints()
BaseQueryImplcanApplyAliasSpecificLockModeHints in class BaseQueryImpltrue indicates they can be applied, false otherwise.protected void applyAliasSpecificLockModeHint(String alias, LockMode lockMode)
BaseQueryImplBaseQueryImpl.canApplyAliasSpecificLockModeHints() has already been
called and returned true.applyAliasSpecificLockModeHint in class BaseQueryImplalias - The alias to apply the 'lockMode' to.lockMode - The LockMode to apply.protected boolean applyLockTimeoutHint(int timeout)
BaseQueryImplapplyLockTimeoutHint in class BaseQueryImpltimeout - The timeout (in seconds!) specified as a hinttrue if the hint was "applied"protected boolean applyCommentHint(String comment)
BaseQueryImplapplyCommentHint in class BaseQueryImplcomment - The comment specified as a hinttrue if the hint was "applied"protected boolean applyFetchSizeHint(int fetchSize)
BaseQueryImplapplyFetchSizeHint in class BaseQueryImplfetchSize - The fetch size specified as a hinttrue if the hint was "applied"public ProcedureCall getHibernateProcedureCall()
Copyright © 2017 JBoss by Red Hat. All rights reserved.