Package org.hibernate.procedure
Interface ProcedureCall
-
- All Superinterfaces:
BasicQueryContract<CommonQueryContract>
,Query
,StoredProcedureQuery
,SynchronizeableQuery
- All Known Subinterfaces:
ProcedureCallImplementor<R>
public interface ProcedureCall extends BasicQueryContract<CommonQueryContract>, SynchronizeableQuery, StoredProcedureQuery
Defines support for executing database stored procedures and functions
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ProcedureCall
addSynchronizedEntityClass(java.lang.Class entityClass)
Adds an entity for (a) auto-flush checking and (b) query result cache invalidation checking.ProcedureCall
addSynchronizedEntityName(java.lang.String entityName)
Adds an entity name for (a) auto-flush checking and (b) query result cache invalidation checking.ProcedureCall
addSynchronizedQuerySpace(java.lang.String querySpace)
Adds a query space.ProcedureCallMemento
extractMemento()
Extract the disconnected representation of this call.ProcedureCallMemento
extractMemento(java.util.Map<java.lang.String,java.lang.Object> hints)
Extract the disconnected representation of this call.ProcedureOutputs
getOutputs()
Retrieves access to outputs of this procedure call.ParameterRegistration
getParameterRegistration(int position)
Retrieve a previously registered parameter memento by the position under which it was registered.ParameterRegistration
getParameterRegistration(java.lang.String name)
Retrieve a previously registered parameter memento by the name under which it was registered.java.lang.String
getProcedureName()
Get the name of the stored procedure to be called.java.util.List<ParameterRegistration>
getRegisteredParameters()
Retrieve all registered parameters.<T> ParameterRegistration<T>
registerParameter(int position, java.lang.Class<T> type, ParameterMode mode)
Basic form for registering a positional parameter.<T> ParameterRegistration<T>
registerParameter(java.lang.String parameterName, java.lang.Class<T> type, ParameterMode mode)
Basic form for registering a named parameter.ProcedureCall
registerParameter0(int position, java.lang.Class type, ParameterMode mode)
Chained form ofregisterParameter(int, Class, javax.persistence.ParameterMode)
ProcedureCall
registerParameter0(java.lang.String parameterName, java.lang.Class type, ParameterMode mode)
-
Methods inherited from interface org.hibernate.BasicQueryContract
getCacheMode, getCacheRegion, getFetchSize, getHibernateFlushMode, getReturnTypes, getTimeout, isCacheable, isReadOnly, setCacheable, setCacheMode, setCacheRegion, setFetchSize, setFlushMode, setHibernateFlushMode, setReadOnly, setTimeout
-
Methods inherited from interface javax.persistence.Query
getFirstResult, getFlushMode, getHints, getLockMode, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, getResultStream, isBound, setFirstResult, setLockMode, setMaxResults, unwrap
-
Methods inherited from interface javax.persistence.StoredProcedureQuery
execute, executeUpdate, getOutputParameterValue, getOutputParameterValue, getResultList, getSingleResult, getUpdateCount, hasMoreResults, registerStoredProcedureParameter, registerStoredProcedureParameter, setFlushMode, setHint, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter
-
Methods inherited from interface org.hibernate.SynchronizeableQuery
addSynchronizedEntityClass, addSynchronizedEntityName, addSynchronizedQuerySpace, addSynchronizedTable, addSynchronizedTable, getSynchronizedQuerySpaces
-
-
-
-
Method Detail
-
addSynchronizedQuerySpace
ProcedureCall addSynchronizedQuerySpace(java.lang.String querySpace)
Description copied from interface:SynchronizeableQuery
Adds a query space.- Specified by:
addSynchronizedQuerySpace
in interfaceSynchronizeableQuery
- Parameters:
querySpace
- The query space to be auto-flushed for this query.- Returns:
this
, for method chaining
-
addSynchronizedEntityName
ProcedureCall addSynchronizedEntityName(java.lang.String entityName) throws MappingException
Description copied from interface:SynchronizeableQuery
Adds an entity name for (a) auto-flush checking and (b) query result cache invalidation checking. Same asSynchronizeableQuery.addSynchronizedQuerySpace(java.lang.String)
for all tables associated with the given entity.- Specified by:
addSynchronizedEntityName
in interfaceSynchronizeableQuery
- Parameters:
entityName
- The name of the entity upon whose defined query spaces we should additionally synchronize.- Returns:
this
, for method chaining- Throws:
MappingException
- Indicates the given name could not be resolved as an entity
-
addSynchronizedEntityClass
ProcedureCall addSynchronizedEntityClass(java.lang.Class entityClass) throws MappingException
Description copied from interface:SynchronizeableQuery
Adds an entity for (a) auto-flush checking and (b) query result cache invalidation checking. Same asSynchronizeableQuery.addSynchronizedQuerySpace(java.lang.String)
for all tables associated with the given entity.- Specified by:
addSynchronizedEntityClass
in interfaceSynchronizeableQuery
- Parameters:
entityClass
- The class of the entity upon whose defined query spaces we should additionally synchronize.- Returns:
this
, for method chaining- Throws:
MappingException
- Indicates the given class could not be resolved as an entity
-
getProcedureName
java.lang.String getProcedureName()
Get the name of the stored procedure to be called.- Returns:
- The procedure name.
-
registerParameter
<T> ParameterRegistration<T> registerParameter(int position, java.lang.Class<T> type, ParameterMode mode)
Basic form for registering a positional parameter.- Type Parameters:
T
- The parameterized Java type of the parameter.- Parameters:
position
- The positiontype
- The Java type of the parametermode
- The parameter mode (in, out, inout)- Returns:
- The parameter registration memento
-
registerParameter0
ProcedureCall registerParameter0(int position, java.lang.Class type, ParameterMode mode)
Chained form ofregisterParameter(int, Class, javax.persistence.ParameterMode)
- Parameters:
position
- The positiontype
- The Java type of the parametermode
- The parameter mode (in, out, inout)- Returns:
this
, for method chaining
-
getParameterRegistration
ParameterRegistration getParameterRegistration(int position)
Retrieve a previously registered parameter memento by the position under which it was registered.- Parameters:
position
- The parameter position- Returns:
- The parameter registration memento
- Throws:
ParameterStrategyException
- If the ProcedureCall is defined using named parametersNoSuchParameterException
- If no parameter with that position exists
-
registerParameter
<T> ParameterRegistration<T> registerParameter(java.lang.String parameterName, java.lang.Class<T> type, ParameterMode mode) throws NamedParametersNotSupportedException
Basic form for registering a named parameter.- Type Parameters:
T
- The parameterized Java type of the parameter.- Parameters:
parameterName
- The parameter nametype
- The Java type of the parametermode
- The parameter mode (in, out, inout)- Returns:
- The parameter registration memento
- Throws:
NamedParametersNotSupportedException
- When the underlying database is known to not support named procedure parameters.
-
registerParameter0
ProcedureCall registerParameter0(java.lang.String parameterName, java.lang.Class type, ParameterMode mode) throws NamedParametersNotSupportedException
- Parameters:
parameterName
- The parameter nametype
- The Java type of the parametermode
- The parameter mode (in, out, inout)- Returns:
- The parameter registration memento
- Throws:
NamedParametersNotSupportedException
- When the underlying database is known to not support named procedure parameters.
-
getParameterRegistration
ParameterRegistration getParameterRegistration(java.lang.String name)
Retrieve a previously registered parameter memento by the name under which it was registered.- Parameters:
name
- The parameter name- Returns:
- The parameter registration memento
- Throws:
ParameterStrategyException
- If the ProcedureCall is defined using positional parametersNoSuchParameterException
- If no parameter with that name exists
-
getRegisteredParameters
java.util.List<ParameterRegistration> getRegisteredParameters()
Retrieve all registered parameters.- Returns:
- The (immutable) list of all registered parameters.
-
getOutputs
ProcedureOutputs getOutputs()
Retrieves access to outputs of this procedure call. Can be called multiple times, returning the same ProcedureOutputs instance each time. If the procedure call has not actually be executed yet, it will be executed and then the ProcedureOutputs will be returned.- Returns:
- The ProcedureOutputs representation
-
extractMemento
ProcedureCallMemento extractMemento(java.util.Map<java.lang.String,java.lang.Object> hints)
Extract the disconnected representation of this call. Used in HEM to allow redefining a named query- Parameters:
hints
- The hints to incorporate into the memento- Returns:
- The memento
-
extractMemento
ProcedureCallMemento extractMemento()
Extract the disconnected representation of this call. Used in HEM to allow redefining a named query *- Returns:
- The memento
-
-