public interface ProcedureCall extends CommonQueryContract, SynchronizeableQuery, StoredProcedureQuery, NameableQuery, AutoCloseable
{call procedureName(...)}{? = call functionName(...)}markAsFunctionCall(int). JPA users could either:storedProcedureQuery.unwrap( ProcedureCall.class .markAsFunctionCall()FUNCTION_RETURN_TYPE_HINT hint (avoids casting to Hibernate-specific classes)markAsFunctionCall(int) implicitly) because
that is the only way PGSQL supports returning REF_CURSOR results.
| Modifier and Type | Field and Description |
|---|---|
static String |
FUNCTION_RETURN_TYPE_HINT
The hint key (for use with JPA's "hint system") indicating the function's return JDBC type code
(aka,
Types code) |
| Modifier and Type | Method and Description |
|---|---|
ProcedureCall |
addSynchronizedEntityClass(Class entityClass)
Adds an entity for (a) auto-flush checking and (b) query result cache invalidation checking.
|
ProcedureCall |
addSynchronizedEntityName(String entityName)
Adds an entity name for (a) auto-flush checking and (b) query result cache invalidation checking.
|
ProcedureCall |
addSynchronizedQuerySpace(String querySpace)
Adds a query space.
|
default void |
close()
Release the underlying JDBC
CallableStatement |
ProcedureOutputs |
getOutputs()
Retrieves access to outputs of this procedure call.
|
ProcedureParameter |
getParameterRegistration(int position)
Retrieve a previously registered parameter memento by the position under which it was registered.
|
ProcedureParameter |
getParameterRegistration(String name)
Retrieve a previously registered parameter memento by the name under which it was registered.
|
String |
getProcedureName()
Get the name of the stored procedure (or function) to be called.
|
List<ProcedureParameter> |
getRegisteredParameters()
Retrieve all registered parameters.
|
boolean |
isFunctionCall()
Does this ProcedureCall represent a call to a database FUNCTION (as opposed
to a PROCEDURE call)?
NOTE : this will only report whether this ProcedureCall was marked
as a function via call to
markAsFunctionCall(int). |
ProcedureCall |
markAsFunctionCall(int sqlType)
Mark this ProcedureCall as representing a call to a database function,
rather than a database procedure.
|
<T> ProcedureParameter<T> |
registerParameter(int position,
Class<T> type,
ParameterMode mode)
Basic form for registering a positional parameter.
|
<T> ProcedureParameter<T> |
registerParameter(String parameterName,
Class<T> type,
ParameterMode mode)
Basic form for registering a named parameter.
|
<T> ProcedureCall |
registerParameter0(int position,
Class<T> type,
ParameterMode mode)
Chained form of
registerParameter(int, Class, javax.persistence.ParameterMode) |
ProcedureCall |
registerParameter0(String parameterName,
Class type,
ParameterMode mode)
|
NamedCallableQueryMemento |
toMemento(String name)
Convert the query into the memento
|
getCacheMode, getCacheRegion, getFetchSize, getHibernateFlushMode, getTimeout, isCacheable, isReadOnly, setCacheable, setCacheMode, setCacheRegion, setFetchSize, setHibernateFlushMode, setReadOnly, setTimeoutaddSynchronizedEntityClass, addSynchronizedEntityName, addSynchronizedQuerySpace, addSynchronizedTable, addSynchronizedTable, getSynchronizedQuerySpacesexecute, executeUpdate, getOutputParameterValue, getOutputParameterValue, getResultList, getSingleResult, getUpdateCount, hasMoreResults, registerStoredProcedureParameter, registerStoredProcedureParameter, setFlushMode, setHint, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParametergetFirstResult, getFlushMode, getHints, getLockMode, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, getResultStream, isBound, setFirstResult, setLockMode, setMaxResults, unwrapstatic final String FUNCTION_RETURN_TYPE_HINT
Types code)String getProcedureName()
boolean isFunctionCall()
markAsFunctionCall(int). Specifically
will not return true when using JPA query hint.true indicates that this ProcedureCall represents a
function call; false indicates a procedure call.ProcedureCall markAsFunctionCall(int sqlType)
sqlType - The Types code for the function returnthis, for method chaining<T> ProcedureParameter<T> registerParameter(int position, Class<T> type, ParameterMode mode)
T - The parameterized Java type of the parameter.position - The positiontype - The Java type of the parametermode - The parameter mode (in, out, inout)<T> ProcedureCall registerParameter0(int position, Class<T> type, ParameterMode mode)
registerParameter(int, Class, javax.persistence.ParameterMode)position - The positiontype - The Java type of the parametermode - The parameter mode (in, out, inout)this, for method chainingProcedureParameter getParameterRegistration(int position)
position - The parameter positionParameterStrategyException - If the ProcedureCall is defined using named parametersNoSuchParameterException - If no parameter with that position exists<T> ProcedureParameter<T> registerParameter(String parameterName, Class<T> type, ParameterMode mode) throws NamedParametersNotSupportedException
T - The parameterized Java type of the parameter.parameterName - The parameter nametype - The Java type of the parametermode - The parameter mode (in, out, inout)NamedParametersNotSupportedException - When the underlying database is known to not support
named procedure parameters.ProcedureCall registerParameter0(String parameterName, Class type, ParameterMode mode) throws NamedParametersNotSupportedException
parameterName - The parameter nametype - The Java type of the parametermode - The parameter mode (in, out, inout)NamedParametersNotSupportedException - When the underlying database is known to not support
named procedure parameters.ProcedureParameter getParameterRegistration(String name)
name - The parameter nameParameterStrategyException - If the ProcedureCall is defined using positional parametersNoSuchParameterException - If no parameter with that name existsList<ProcedureParameter> getRegisteredParameters()
ProcedureOutputs getOutputs()
default void close()
CallableStatementclose in interface AutoCloseableProcedureCall addSynchronizedQuerySpace(String querySpace)
SynchronizeableQueryaddSynchronizedQuerySpace in interface SynchronizeableQueryquerySpace - The query space to be auto-flushed for this query.this, for method chainingProcedureCall addSynchronizedEntityName(String entityName) throws MappingException
SynchronizeableQuerySynchronizeableQuery.addSynchronizedQuerySpace(java.lang.String) for all tables associated with the given entity.addSynchronizedEntityName in interface SynchronizeableQueryentityName - The name of the entity upon whose defined query spaces we should additionally synchronize.this, for method chainingMappingException - Indicates the given name could not be resolved as an entityProcedureCall addSynchronizedEntityClass(Class entityClass) throws MappingException
SynchronizeableQuerySynchronizeableQuery.addSynchronizedQuerySpace(java.lang.String) for all tables associated with the given entity.addSynchronizedEntityClass in interface SynchronizeableQueryentityClass - The class of the entity upon whose defined query spaces we should additionally synchronize.this, for method chainingMappingException - Indicates the given class could not be resolved as an entityNamedCallableQueryMemento toMemento(String name)
NameableQuerytoMemento in interface NameableQueryCopyright © 2001-2021 Red Hat, Inc. All Rights Reserved.