Package org.hibernate.procedure.internal
Class ProcedureCallImpl<R>
- java.lang.Object
-
- org.hibernate.query.spi.AbstractCommonQueryContract
-
- org.hibernate.query.spi.AbstractSelectionQuery<R>
-
- org.hibernate.query.spi.AbstractQuery<R>
-
- org.hibernate.procedure.internal.ProcedureCallImpl<R>
-
- All Implemented Interfaces:
jakarta.persistence.Query
,jakarta.persistence.StoredProcedureQuery
,jakarta.persistence.TypedQuery<R>
,AutoCloseable
,ProcedureCall
,ProcedureCallImplementor<R>
,CommonQueryContract
,MutationQuery
,NameableQuery
,Query<R>
,SelectionQuery<R>
,DomainQueryExecutionContext
,QueryImplementor<R>
,SynchronizeableQuery
,ResultContext
public class ProcedureCallImpl<R> extends AbstractQuery<R> implements ProcedureCallImplementor<R>, ResultContext
Standard implementation ofProcedureCall
-
-
Field Summary
-
Fields inherited from class org.hibernate.query.spi.AbstractQuery
log
-
Fields inherited from class org.hibernate.query.spi.AbstractSelectionQuery
CRITERIA_HQL_STRING
-
Fields inherited from interface org.hibernate.procedure.ProcedureCall
FUNCTION_RETURN_TYPE_HINT
-
-
Constructor Summary
Constructors Constructor Description ProcedureCallImpl(SharedSessionContractImplementor session, String procedureName)
The no-returns form.ProcedureCallImpl(SharedSessionContractImplementor session, String procedureName, Class<?>... resultClasses)
The result Class(es) return formProcedureCallImpl(SharedSessionContractImplementor session, String procedureName, String... resultSetMappingNames)
The result-set-mapping(s) return formProcedureCallImpl(SharedSessionContractImplementor session, NamedCallableQueryMementoImpl memento, String... resultSetMappingNames)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProcedureCallImplementor<R>
addSynchronizedEntityClass(Class entityClass)
Adds an entity for (a) auto-flush checking and (b) query result cache invalidation checking.ProcedureCallImplementor<R>
addSynchronizedEntityName(String entityName)
Adds an entity name for (a) auto-flush checking and (b) query result cache invalidation checking.ProcedureCallImplementor<R>
addSynchronizedQuerySpace(String querySpace)
Adds a query space.protected void
addSynchronizedQuerySpaces(EntityPersister persister)
Query<R>
applyGraph(RootGraph graph, GraphSemantic semantic)
Apply the given graph using the given semanticprotected void
applyGraph(RootGraphImplementor<?> entityGraph, GraphSemantic graphSemantic)
protected void
applyOptions(NamedCallableQueryMemento memento)
protected int
doExecuteUpdate()
protected List<R>
doList()
protected ScrollableResultsImplementor<R>
doScroll(ScrollMode scrollMode)
boolean
execute()
FunctionReturnImplementor<R>
getFunctionReturn()
jakarta.persistence.LockModeType
getLockMode()
Get the rootLockModeType
for the queryObject
getOutputParameterValue(int position)
Object
getOutputParameterValue(String parameterName)
ProcedureOutputs
getOutputs()
Retrieves access to outputs of this procedure call.QueryParameterBindings
getParameterBindings()
ProcedureParameterMetadataImpl
getParameterMetadata()
Access to information about query parameters.ProcedureParameterImplementor<?>
getParameterRegistration(int position)
Retrieve a previously registered parameter memento by the position under which it was registered.ProcedureParameterImplementor<?>
getParameterRegistration(String name)
Retrieve a previously registered parameter memento by the name under which it was registered.ParameterStrategy
getParameterStrategy()
String
getProcedureName()
Get the name of the stored procedure (or function) to be called.MutableQueryOptions
getQueryOptions()
Get the execution options for thisQuery
.QueryParameterBindings
getQueryParameterBindings()
The domain parameter bindingsString
getQueryString()
The query as a string, ornull
in the case of a criteria query.List
getRegisteredParameters()
Retrieve all registered parameters.List<R>
getResultList()
Execute the query and return the query results as aList
.ResultSetMapping
getResultSetMapping()
Stream<R>
getResultStream()
Execute the query and return the query results as aStream
.SessionFactoryImplementor
getSessionFactory()
R
getSingleResult()
Execute the query and return the single result of the query, throwing an exception if the query returns no results.R
getSingleResultOrNull()
Execute the query and return the single result of the query, ornull
if the query returns no results.Set<String>
getSynchronizedQuerySpaces()
Obtain the list of query spaces the query is synchronized on.int
getUpdateCount()
boolean
hasMoreResults()
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 toProcedureCall.markAsFunctionCall(int)
.ProcedureCallImpl<R>
markAsFunctionCall(int sqlType)
Mark this ProcedureCall as representing a call to a database function, rather than a database procedure.ProcedureCallImpl<R>
markAsFunctionCall(Class<?> resultType)
Mark this ProcedureCall as representing a call to a database function, rather than a database procedure.ProcedureCallImpl<R>
markAsFunctionCall(BasicTypeReference<?> typeReference)
Mark this ProcedureCall as representing a call to a database function, rather than a database procedure.protected ProcedureOutputs
outputs()
<T> ProcedureParameter<T>
registerParameter(int position, Class<T> javaType, jakarta.persistence.ParameterMode mode)
Basic form for registering a positional parameter.<T> ProcedureParameter<T>
registerParameter(int position, BasicTypeReference<T> typeReference, jakarta.persistence.ParameterMode mode)
Basic form for registering a positional parameter.<T> ProcedureParameterImplementor<T>
registerParameter(String name, Class<T> javaType, jakarta.persistence.ParameterMode mode)
Basic form for registering a named parameter.<T> ProcedureParameterImplementor<T>
registerParameter(String name, BasicTypeReference<T> typeReference, jakarta.persistence.ParameterMode mode)
Basic form for registering a named parameter.ProcedureCallImplementor<R>
registerStoredProcedureParameter(int position, Class type, jakarta.persistence.ParameterMode mode)
ProcedureCallImplementor<R>
registerStoredProcedureParameter(int position, BasicTypeReference<?> type, jakarta.persistence.ParameterMode mode)
LikeProcedureCall.registerStoredProcedureParameter(int, Class, ParameterMode)
but a basic type reference is given instead of a class for the parameter type.ProcedureCallImplementor<R>
registerStoredProcedureParameter(String parameterName, Class type, jakarta.persistence.ParameterMode mode)
ProcedureCallImplementor<R>
registerStoredProcedureParameter(String parameterName, BasicTypeReference<?> type, jakarta.persistence.ParameterMode mode)
LikeProcedureCall.registerStoredProcedureParameter(String, Class, ParameterMode)
but a basic type reference is given instead of a class for the parameter type.ScrollableResultsImplementor<R>
scroll(ScrollMode scrollMode)
Returns scrollable access to the query results.ProcedureCallImplementor<R>
setFlushMode(jakarta.persistence.FlushModeType flushModeType)
Set theFlushMode
in to use for this query.ProcedureCallImplementor<R>
setHint(String hintName, Object value)
Apply hints to the query.ProcedureCallImplementor<R>
setLockMode(jakarta.persistence.LockModeType lockMode)
Specify the root LockModeType for the queryQueryImplementor<R>
setLockMode(String alias, LockMode lockMode)
Specify aLockMode
to apply to a specific alias defined in the queryQueryImplementor<R>
setLockOptions(LockOptions lockOptions)
Apply the given lock options to this query.ProcedureCallImplementor<R>
setParameter(int position, Object value)
Bind the given argument to an ordinal query parameter.ProcedureCallImplementor<R>
setParameter(int position, Calendar value, jakarta.persistence.TemporalType temporalPrecision)
Query
overrideProcedureCallImplementor<R>
setParameter(int position, Date value, jakarta.persistence.TemporalType temporalPrecision)
Query
override<P> ProcedureCallImplementor<R>
setParameter(int position, P value, BindableType<P> type)
Bind the given argument to an ordinal query parameter using the givenBindableType
.ProcedureCallImplementor<R>
setParameter(jakarta.persistence.Parameter<Calendar> parameter, Calendar value, jakarta.persistence.TemporalType temporalPrecision)
Query
overrideProcedureCallImplementor<R>
setParameter(jakarta.persistence.Parameter<Date> parameter, Date value, jakarta.persistence.TemporalType temporalPrecision)
Query
override<P> ProcedureCallImplementor<R>
setParameter(jakarta.persistence.Parameter<P> parameter, P value)
Query
overrideProcedureCallImplementor<R>
setParameter(String name, Object value)
Bind the given argument to a named query parameter.ProcedureCallImplementor<R>
setParameter(String name, Calendar value, jakarta.persistence.TemporalType temporalPrecision)
Query
overrideProcedureCallImplementor<R>
setParameter(String name, Date value, jakarta.persistence.TemporalType temporalPrecision)
Query
override<P> ProcedureCallImplementor<R>
setParameter(String name, P value, BindableType<P> type)
Bind the given argument to a named query parameter using the givenBindableType
.<P> ProcedureCallImplementor<R>
setParameter(QueryParameter<P> parameter, P value)
Bind an argument to the query parameter represented by the givenQueryParameter
.<P> ProcedureCallImplementor<R>
setParameter(QueryParameter<P> parameter, P value, BindableType<P> type)
Bind an argument to the query parameter represented by the givenQueryParameter
, using the givenBindableType
.protected Set<String>
synchronizedQuerySpaces()
Use this form instead ofgetSynchronizedQuerySpaces()
when you want to make sure the underlying Set is instantiated (aka, on add)NamedCallableQueryMemento
toMemento(String name)
Convert the query into the memento<T> T
unwrap(Class<T> cls)
-
Methods inherited from class org.hibernate.query.spi.AbstractQuery
addQueryHint, applyOptions, collectHints, executeUpdate, getComment, getFirstResult, getFlushMode, getLockOptions, getMaxResults, getParameters, getSupportedHints, isCacheable, prepareForExecution, resolveJdbcParameterTypeIfNecessary, setCacheable, setCacheMode, setCacheRegion, setCacheRetrieveMode, setCacheStoreMode, setComment, setFetchSize, setFirstResult, setHibernateFlushMode, setMaxResults, setOptionalEntityName, setOptionalId, setOptionalObject, setParameter, setParameter, setParameter, setParameter, setParameter, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setProperties, setProperties, setReadOnly, setResultListTransformer, setTimeout, setTupleTransformer
-
Methods inherited from class org.hibernate.query.spi.AbstractSelectionQuery
afterQuery, applyOptions, beforeQuery, buildTupleMetadata, checkQueryReturnType, getCacheMode, getCacheRegion, getCacheRetrieveMode, getCacheStoreMode, getCallback, getFetchSize, getHibernateLockMode, hasAppliedGraph, hasLimit, isReadOnly, list, requiresTxn, resetCallback, scroll, setAliasSpecificLockMode, setFollowOnLocking, setHibernateLockMode, stream, uniqueElement, uniqueResult, uniqueResultOptional, verifyResultType, visitQueryReturnType
-
Methods inherited from class org.hibernate.query.spi.AbstractCommonQueryContract
applyAdditionalPossibleHints, applyAliasSpecificLockModeHint, applyCacheableHint, applyCacheModeHint, applyCacheRegionHint, applyCommentHint, applyEntityGraphHint, applyFetchSizeHint, applyFirstResult, applyFlushModeHint, applyFollowOnLockingHint, applyGraph, applyHibernateLockMode, applyHint, applyJpaCacheRetrieveModeHint, applyJpaCacheStoreModeHint, applyJpaFlushMode, applyLockModeHint, applyLockModeType, applyLockTimeoutHint, applyLockTimeoutHint, applyMaxResults, applyResultListTransformer, applySelectionHint, applySynchronizeSpacesHint, applyTimeoutHint, applyTupleTransformer, determineType, getHibernateFlushMode, getHints, getIntegerLiteral, getJpaFlushMode, getMaxRows, getParameter, getParameter, getParameter, getParameter, getParameterValue, getParameterValue, getParameterValue, getSession, getTimeout, isBound, locateBinding, locateBinding, locateBinding, locateBinding, putIfNotNull, putIfNotNull
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.query.CommonQueryContract
getFlushMode, getHibernateFlushMode, getTimeout
-
Methods inherited from interface org.hibernate.query.spi.DomainQueryExecutionContext
getSession
-
Methods inherited from interface org.hibernate.procedure.ProcedureCall
close
-
Methods inherited from interface jakarta.persistence.Query
getFirstResult, getFlushMode, getHints, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, isBound
-
Methods inherited from interface org.hibernate.query.Query
addQueryHint, applyFetchGraph, applyLoadGraph, executeUpdate, getComment, getLockOptions, list, setCacheable, setCacheMode, setCacheRegion, setCacheRetrieveMode, setCacheStoreMode, setComment, setFetchSize, setFirstResult, setHibernateFlushMode, setMaxResults, setReadOnly, setTimeout, stream, uniqueResult, uniqueResultOptional
-
Methods inherited from interface org.hibernate.query.spi.QueryImplementor
getSession, scroll, setOptionalEntityName, setOptionalId, setOptionalObject, setParameter, setParameter, setParameter, setParameter, setParameter, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setProperties, setProperties, setResultListTransformer, setResultTransformer, setTupleTransformer
-
Methods inherited from interface org.hibernate.result.spi.ResultContext
getSession
-
Methods inherited from interface org.hibernate.query.SelectionQuery
getCacheMode, getCacheRegion, getCacheRetrieveMode, getCacheStoreMode, getFetchSize, getFirstResult, getHibernateLockMode, getMaxResults, isCacheable, isReadOnly, setAliasSpecificLockMode, setFollowOnLocking, setHibernateLockMode
-
-
-
-
Constructor Detail
-
ProcedureCallImpl
public ProcedureCallImpl(SharedSessionContractImplementor session, String procedureName)
The no-returns form.- Parameters:
session
- The sessionprocedureName
- The name of the procedure to call
-
ProcedureCallImpl
public ProcedureCallImpl(SharedSessionContractImplementor session, String procedureName, Class<?>... resultClasses)
The result Class(es) return form- Parameters:
session
- The sessionprocedureName
- The name of the procedure to callresultClasses
- The classes making up the result
-
ProcedureCallImpl
public ProcedureCallImpl(SharedSessionContractImplementor session, String procedureName, String... resultSetMappingNames)
The result-set-mapping(s) return form- Parameters:
session
- The sessionprocedureName
- The name of the procedure to callresultSetMappingNames
- The names of the result set mappings making up the result
-
ProcedureCallImpl
public ProcedureCallImpl(SharedSessionContractImplementor session, NamedCallableQueryMementoImpl memento, String... resultSetMappingNames)
-
-
Method Detail
-
applyOptions
protected void applyOptions(NamedCallableQueryMemento memento)
-
getProcedureName
public String getProcedureName()
Description copied from interface:ProcedureCall
Get the name of the stored procedure (or function) to be called.- Specified by:
getProcedureName
in interfaceProcedureCall
- Returns:
- The procedure name.
-
getQueryOptions
public MutableQueryOptions getQueryOptions()
Description copied from interface:Query
Get the execution options for thisQuery
. Many of the setters of this object update the state of the returnedQueryOptions
. This is useful because it gives access to s primitive value in its (nullable) wrapper form, rather than the primitive form as required by JPA. This allows us to distinguish whether a value has been explicitly set by the client.- Specified by:
getQueryOptions
in interfaceDomainQueryExecutionContext
- Specified by:
getQueryOptions
in interfaceQuery<R>
- Specified by:
getQueryOptions
in interfaceResultContext
- Overrides:
getQueryOptions
in classAbstractQuery<R>
- Returns:
- Return the encapsulation of this query's options.
-
getParameterMetadata
public ProcedureParameterMetadataImpl getParameterMetadata()
Description copied from interface:Query
Access to information about query parameters.- Specified by:
getParameterMetadata
in interfaceProcedureCallImplementor<R>
- Specified by:
getParameterMetadata
in interfaceQuery<R>
- Specified by:
getParameterMetadata
in classAbstractCommonQueryContract
- Returns:
- information about query parameters.
-
getQueryParameterBindings
public QueryParameterBindings getQueryParameterBindings()
Description copied from interface:DomainQueryExecutionContext
The domain parameter bindings- Specified by:
getQueryParameterBindings
in interfaceDomainQueryExecutionContext
- Specified by:
getQueryParameterBindings
in classAbstractCommonQueryContract
-
getParameterStrategy
public ParameterStrategy getParameterStrategy()
- Specified by:
getParameterStrategy
in interfaceProcedureCallImplementor<R>
-
isFunctionCall
public boolean isFunctionCall()
Description copied from interface:ProcedureCall
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 toProcedureCall.markAsFunctionCall(int)
. Specifically will not returntrue
when using JPA query hint.- Specified by:
isFunctionCall
in interfaceProcedureCall
- Returns:
true
indicates that this ProcedureCall represents a function call;false
indicates a procedure call.
-
getFunctionReturn
public FunctionReturnImplementor<R> getFunctionReturn()
- Specified by:
getFunctionReturn
in interfaceProcedureCallImplementor<R>
-
markAsFunctionCall
public ProcedureCallImpl<R> markAsFunctionCall(int sqlType)
Description copied from interface:ProcedureCall
Mark this ProcedureCall as representing a call to a database function, rather than a database procedure.- Specified by:
markAsFunctionCall
in interfaceProcedureCall
- Parameters:
sqlType
- TheTypes
code for the function return- Returns:
this
, for method chaining
-
markAsFunctionCall
public ProcedureCallImpl<R> markAsFunctionCall(Class<?> resultType)
Description copied from interface:ProcedureCall
Mark this ProcedureCall as representing a call to a database function, rather than a database procedure.- Specified by:
markAsFunctionCall
in interfaceProcedureCall
- Parameters:
resultType
- The result type for the function return- Returns:
this
, for method chaining
-
markAsFunctionCall
public ProcedureCallImpl<R> markAsFunctionCall(BasicTypeReference<?> typeReference)
Description copied from interface:ProcedureCall
Mark this ProcedureCall as representing a call to a database function, rather than a database procedure.- Specified by:
markAsFunctionCall
in interfaceProcedureCall
- Parameters:
typeReference
- The result type for the function return- Returns:
this
, for method chaining
-
getParameterBindings
public QueryParameterBindings getParameterBindings()
- Specified by:
getParameterBindings
in interfaceQueryImplementor<R>
-
getSessionFactory
public SessionFactoryImplementor getSessionFactory()
- Overrides:
getSessionFactory
in classAbstractSelectionQuery<R>
-
registerStoredProcedureParameter
public ProcedureCallImplementor<R> registerStoredProcedureParameter(int position, Class type, jakarta.persistence.ParameterMode mode)
- Specified by:
registerStoredProcedureParameter
in interfaceProcedureCall
- Specified by:
registerStoredProcedureParameter
in interfaceProcedureCallImplementor<R>
- Specified by:
registerStoredProcedureParameter
in interfacejakarta.persistence.StoredProcedureQuery
-
registerStoredProcedureParameter
public ProcedureCallImplementor<R> registerStoredProcedureParameter(String parameterName, Class type, jakarta.persistence.ParameterMode mode)
- Specified by:
registerStoredProcedureParameter
in interfaceProcedureCall
- Specified by:
registerStoredProcedureParameter
in interfaceProcedureCallImplementor<R>
- Specified by:
registerStoredProcedureParameter
in interfacejakarta.persistence.StoredProcedureQuery
-
registerStoredProcedureParameter
public ProcedureCallImplementor<R> registerStoredProcedureParameter(int position, BasicTypeReference<?> type, jakarta.persistence.ParameterMode mode)
Description copied from interface:ProcedureCall
LikeProcedureCall.registerStoredProcedureParameter(int, Class, ParameterMode)
but a basic type reference is given instead of a class for the parameter type.- Specified by:
registerStoredProcedureParameter
in interfaceProcedureCall
- Specified by:
registerStoredProcedureParameter
in interfaceProcedureCallImplementor<R>
-
registerStoredProcedureParameter
public ProcedureCallImplementor<R> registerStoredProcedureParameter(String parameterName, BasicTypeReference<?> type, jakarta.persistence.ParameterMode mode)
Description copied from interface:ProcedureCall
LikeProcedureCall.registerStoredProcedureParameter(String, Class, ParameterMode)
but a basic type reference is given instead of a class for the parameter type.- Specified by:
registerStoredProcedureParameter
in interfaceProcedureCall
- Specified by:
registerStoredProcedureParameter
in interfaceProcedureCallImplementor<R>
-
registerParameter
public <T> ProcedureParameter<T> registerParameter(int position, Class<T> javaType, jakarta.persistence.ParameterMode mode)
Description copied from interface:ProcedureCall
Basic form for registering a positional parameter.- Specified by:
registerParameter
in interfaceProcedureCall
- Type Parameters:
T
- The parameterized Java type of the parameter.- Parameters:
position
- The positionjavaType
- The Java type of the parametermode
- The parameter mode (in, out, inout)- Returns:
- The parameter registration memento
-
registerParameter
public <T> ProcedureParameter<T> registerParameter(int position, BasicTypeReference<T> typeReference, jakarta.persistence.ParameterMode mode)
Description copied from interface:ProcedureCall
Basic form for registering a positional parameter.- Specified by:
registerParameter
in interfaceProcedureCall
- Type Parameters:
T
- The parameterized Java type of the parameter.- Parameters:
position
- The positiontypeReference
- The type reference of the parameter typemode
- The parameter mode (in, out, inout)- Returns:
- The parameter registration memento
-
getParameterRegistration
public ProcedureParameterImplementor<?> getParameterRegistration(int position)
Description copied from interface:ProcedureCall
Retrieve a previously registered parameter memento by the position under which it was registered.- Specified by:
getParameterRegistration
in interfaceProcedureCall
- Parameters:
position
- The parameter position- Returns:
- The parameter registration memento
-
registerParameter
public <T> ProcedureParameterImplementor<T> registerParameter(String name, Class<T> javaType, jakarta.persistence.ParameterMode mode)
Description copied from interface:ProcedureCall
Basic form for registering a named parameter.- Specified by:
registerParameter
in interfaceProcedureCall
- Type Parameters:
T
- The parameterized Java type of the parameter.- Parameters:
name
- The parameter namejavaType
- The Java type of the parametermode
- The parameter mode (in, out, inout)- Returns:
- The parameter registration memento
-
registerParameter
public <T> ProcedureParameterImplementor<T> registerParameter(String name, BasicTypeReference<T> typeReference, jakarta.persistence.ParameterMode mode)
Description copied from interface:ProcedureCall
Basic form for registering a named parameter.- Specified by:
registerParameter
in interfaceProcedureCall
- Type Parameters:
T
- The parameterized Java type of the parameter.- Parameters:
name
- The parameter nametypeReference
- The type reference of the parameter typemode
- The parameter mode (in, out, inout)- Returns:
- The parameter registration memento
-
getParameterRegistration
public ProcedureParameterImplementor<?> getParameterRegistration(String name)
Description copied from interface:ProcedureCall
Retrieve a previously registered parameter memento by the name under which it was registered.- Specified by:
getParameterRegistration
in interfaceProcedureCall
- Parameters:
name
- The parameter name- Returns:
- The parameter registration memento
-
getRegisteredParameters
public List getRegisteredParameters()
Description copied from interface:ProcedureCall
Retrieve all registered parameters.- Specified by:
getRegisteredParameters
in interfaceProcedureCall
- Returns:
- The (immutable) list of all registered parameters.
-
getOutputs
public ProcedureOutputs getOutputs()
Description copied from interface:ProcedureCall
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.
- Specified by:
getOutputs
in interfaceProcedureCall
- Returns:
- The ProcedureOutputs representation
-
getQueryString
public String getQueryString()
Description copied from interface:Query
The query as a string, ornull
in the case of a criteria query.- Specified by:
getQueryString
in interfaceQuery<R>
- Specified by:
getQueryString
in classAbstractSelectionQuery<R>
-
synchronizedQuerySpaces
protected Set<String> synchronizedQuerySpaces()
Use this form instead ofgetSynchronizedQuerySpaces()
when you want to make sure the underlying Set is instantiated (aka, on add)- Returns:
- The spaces
-
getSynchronizedQuerySpaces
public Set<String> getSynchronizedQuerySpaces()
Description copied from interface:SynchronizeableQuery
Obtain the list of query spaces the query is synchronized on.- Specified by:
getSynchronizedQuerySpaces
in interfaceResultContext
- Specified by:
getSynchronizedQuerySpaces
in interfaceSynchronizeableQuery
- Returns:
- The list of query spaces upon which the query is synchronized.
-
addSynchronizedQuerySpace
public ProcedureCallImplementor<R> addSynchronizedQuerySpace(String querySpace)
Description copied from interface:SynchronizeableQuery
Adds a query space.- Specified by:
addSynchronizedQuerySpace
in interfaceProcedureCall
- Specified by:
addSynchronizedQuerySpace
in interfaceSynchronizeableQuery
- Parameters:
querySpace
- The query space to be auto-flushed for this query.- Returns:
this
, for method chaining
-
addSynchronizedEntityName
public ProcedureCallImplementor<R> addSynchronizedEntityName(String entityName)
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 interfaceProcedureCall
- 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
-
addSynchronizedQuerySpaces
protected void addSynchronizedQuerySpaces(EntityPersister persister)
-
addSynchronizedEntityClass
public ProcedureCallImplementor<R> addSynchronizedEntityClass(Class entityClass)
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 interfaceProcedureCall
- 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
-
toMemento
public NamedCallableQueryMemento toMemento(String name)
Description copied from interface:NameableQuery
Convert the query into the memento- Specified by:
toMemento
in interfaceNameableQuery
- Specified by:
toMemento
in interfaceProcedureCall
-
applyGraph
protected void applyGraph(RootGraphImplementor<?> entityGraph, GraphSemantic graphSemantic)
- Overrides:
applyGraph
in classAbstractCommonQueryContract
-
applyGraph
public Query<R> applyGraph(RootGraph graph, GraphSemantic semantic)
Description copied from interface:Query
Apply the given graph using the given semantic- Specified by:
applyGraph
in interfaceQuery<R>
- Parameters:
graph
- The graph the apply.semantic
- The semantic to use when applying the graph- Returns:
- this - for method chaining
-
execute
public boolean execute()
- Specified by:
execute
in interfacejakarta.persistence.StoredProcedureQuery
-
outputs
protected ProcedureOutputs outputs()
-
doExecuteUpdate
protected int doExecuteUpdate()
- Specified by:
doExecuteUpdate
in classAbstractQuery<R>
-
getOutputParameterValue
public Object getOutputParameterValue(int position)
- Specified by:
getOutputParameterValue
in interfacejakarta.persistence.StoredProcedureQuery
-
getOutputParameterValue
public Object getOutputParameterValue(String parameterName)
- Specified by:
getOutputParameterValue
in interfacejakarta.persistence.StoredProcedureQuery
-
hasMoreResults
public boolean hasMoreResults()
- Specified by:
hasMoreResults
in interfacejakarta.persistence.StoredProcedureQuery
-
getUpdateCount
public int getUpdateCount()
- Specified by:
getUpdateCount
in interfacejakarta.persistence.StoredProcedureQuery
-
doList
protected List<R> doList()
- Specified by:
doList
in classAbstractSelectionQuery<R>
-
scroll
public ScrollableResultsImplementor<R> scroll(ScrollMode scrollMode)
Description copied from interface:SelectionQuery
Returns scrollable access to the query results. The capabilities of the returned ScrollableResults depend on the specified ScrollMode.- Specified by:
scroll
in interfaceQuery<R>
- Specified by:
scroll
in interfaceQueryImplementor<R>
- Specified by:
scroll
in interfaceSelectionQuery<R>
- Overrides:
scroll
in classAbstractSelectionQuery<R>
-
doScroll
protected ScrollableResultsImplementor<R> doScroll(ScrollMode scrollMode)
- Specified by:
doScroll
in classAbstractSelectionQuery<R>
-
getResultList
public List<R> getResultList()
Description copied from interface:Query
Execute the query and return the query results as aList
. If the query contains multiple items in the selection list, then by default each result in the list is packaged in an array of typeObject[]
.- Specified by:
getResultList
in interfaceProcedureCallImplementor<R>
- Specified by:
getResultList
in interfacejakarta.persistence.Query
- Specified by:
getResultList
in interfaceQuery<R>
- Specified by:
getResultList
in interfaceSelectionQuery<R>
- Specified by:
getResultList
in interfacejakarta.persistence.StoredProcedureQuery
- Specified by:
getResultList
in interfacejakarta.persistence.TypedQuery<R>
- Returns:
- the results as a list
-
getSingleResult
public R getSingleResult()
Description copied from interface:SelectionQuery
Execute the query and return the single result of the query, throwing an exception if the query returns no results.- Specified by:
getSingleResult
in interfaceProcedureCallImplementor<R>
- Specified by:
getSingleResult
in interfacejakarta.persistence.Query
- Specified by:
getSingleResult
in interfaceQuery<R>
- Specified by:
getSingleResult
in interfaceSelectionQuery<R>
- Specified by:
getSingleResult
in interfacejakarta.persistence.StoredProcedureQuery
- Specified by:
getSingleResult
in interfacejakarta.persistence.TypedQuery<R>
- Overrides:
getSingleResult
in classAbstractSelectionQuery<R>
- Returns:
- the single result, only if there is exactly one
-
getSingleResultOrNull
public R getSingleResultOrNull()
Description copied from interface:SelectionQuery
Execute the query and return the single result of the query, ornull
if the query returns no results.- Specified by:
getSingleResultOrNull
in interfaceSelectionQuery<R>
- Overrides:
getSingleResultOrNull
in classAbstractSelectionQuery<R>
- Returns:
- the single result or
null
if there is no result to return
-
unwrap
public <T> T unwrap(Class<T> cls)
- Specified by:
unwrap
in interfacejakarta.persistence.Query
-
setLockMode
public QueryImplementor<R> setLockMode(String alias, LockMode lockMode)
Description copied from interface:SelectionQuery
Specify aLockMode
to apply to a specific alias defined in the query- Specified by:
setLockMode
in interfaceQuery<R>
- Specified by:
setLockMode
in interfaceSelectionQuery<R>
- Overrides:
setLockMode
in classAbstractQuery<R>
- Parameters:
alias
- A query aliaslockMode
- The lock mode to apply- Returns:
this
, for method chaining- See Also:
Query.getLockOptions()
-
setLockMode
public ProcedureCallImplementor<R> setLockMode(jakarta.persistence.LockModeType lockMode)
Description copied from class:AbstractSelectionQuery
Specify the root LockModeType for the query- Specified by:
setLockMode
in interfacejakarta.persistence.Query
- Specified by:
setLockMode
in interfaceQuery<R>
- Specified by:
setLockMode
in interfaceSelectionQuery<R>
- Specified by:
setLockMode
in interfacejakarta.persistence.TypedQuery<R>
- Overrides:
setLockMode
in classAbstractQuery<R>
- See Also:
AbstractSelectionQuery.setHibernateLockMode(org.hibernate.LockMode)
-
getLockMode
public jakarta.persistence.LockModeType getLockMode()
Description copied from interface:SelectionQuery
Get the rootLockModeType
for the query- Specified by:
getLockMode
in interfacejakarta.persistence.Query
- Specified by:
getLockMode
in interfaceSelectionQuery<R>
- Overrides:
getLockMode
in classAbstractQuery<R>
- See Also:
SelectionQuery.getHibernateLockMode()
-
setLockOptions
public QueryImplementor<R> setLockOptions(LockOptions lockOptions)
Description copied from interface:Query
Apply the given lock options to this query. Alias-specific lock modes in the given lock options are merged with any alias-specific lock mode which have already been set. If a lock mode has already been specified for an alias that is among the aliases in the given lock options, the lock mode specified in the given lock options overrides the lock mode that was already set.- Specified by:
setLockOptions
in interfaceQuery<R>
- Overrides:
setLockOptions
in classAbstractQuery<R>
- Parameters:
lockOptions
- The lock options to apply to the query.- Returns:
this
, for method chaining- See Also:
Query.getLockOptions()
-
setHint
public ProcedureCallImplementor<R> setHint(String hintName, Object value)
Description copied from interface:CommonQueryContract
Apply hints to the query.- Specified by:
setHint
in interfaceCommonQueryContract
- Specified by:
setHint
in interfaceProcedureCall
- Specified by:
setHint
in interfaceProcedureCallImplementor<R>
- Specified by:
setHint
in interfacejakarta.persistence.Query
- Specified by:
setHint
in interfaceQuery<R>
- Specified by:
setHint
in interfaceSelectionQuery<R>
- Specified by:
setHint
in interfacejakarta.persistence.StoredProcedureQuery
- Specified by:
setHint
in interfacejakarta.persistence.TypedQuery<R>
- Overrides:
setHint
in classAbstractQuery<R>
-
setFlushMode
public ProcedureCallImplementor<R> setFlushMode(jakarta.persistence.FlushModeType flushModeType)
Description copied from interface:CommonQueryContract
Set theFlushMode
in to use for this query.- Specified by:
setFlushMode
in interfaceCommonQueryContract
- Specified by:
setFlushMode
in interfaceProcedureCall
- Specified by:
setFlushMode
in interfaceProcedureCallImplementor<R>
- Specified by:
setFlushMode
in interfacejakarta.persistence.Query
- Specified by:
setFlushMode
in interfaceQuery<R>
- Specified by:
setFlushMode
in interfaceSelectionQuery<R>
- Specified by:
setFlushMode
in interfacejakarta.persistence.StoredProcedureQuery
- Specified by:
setFlushMode
in interfacejakarta.persistence.TypedQuery<R>
- Overrides:
setFlushMode
in classAbstractQuery<R>
- See Also:
CommonQueryContract.getHibernateFlushMode()
,Session.getHibernateFlushMode()
-
setParameter
public <P> ProcedureCallImplementor<R> setParameter(QueryParameter<P> parameter, P value)
Description copied from interface:CommonQueryContract
Bind an argument to the query parameter represented by the givenQueryParameter
.If the type of the parameter cannot be inferred from the context in which it occurs, use one of the forms which accepts a "type".
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQueryImplementor<R>
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Overrides:
setParameter
in classAbstractQuery<R>
- Parameters:
parameter
- the query parameter mementovalue
- the argument, which might be null- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameter(QueryParameter, Object, BindableType)
-
setParameter
public <P> ProcedureCallImplementor<R> setParameter(jakarta.persistence.Parameter<P> parameter, P value)
Description copied from interface:Query
Query
override- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceProcedureCall
- Specified by:
setParameter
in interfaceProcedureCallImplementor<R>
- Specified by:
setParameter
in interfacejakarta.persistence.Query
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQueryImplementor<R>
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfacejakarta.persistence.StoredProcedureQuery
- Specified by:
setParameter
in interfacejakarta.persistence.TypedQuery<R>
- Overrides:
setParameter
in classAbstractQuery<R>
- See Also:
Query.setParameter(Parameter, Object)
-
setParameter
public ProcedureCallImplementor<R> setParameter(String name, Object value)
Description copied from interface:CommonQueryContract
Bind the given argument to a named query parameter.If the type of the parameter cannot be inferred from the context in which it occurs, use one of the forms which accepts a "type".
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceProcedureCall
- Specified by:
setParameter
in interfaceProcedureCallImplementor<R>
- Specified by:
setParameter
in interfacejakarta.persistence.Query
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQueryImplementor<R>
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfacejakarta.persistence.StoredProcedureQuery
- Specified by:
setParameter
in interfacejakarta.persistence.TypedQuery<R>
- Overrides:
setParameter
in classAbstractQuery<R>
- See Also:
CommonQueryContract.setParameter(String, Object, Class)
,CommonQueryContract.setParameter(String, Object, BindableType)
-
setParameter
public ProcedureCallImplementor<R> setParameter(int position, Object value)
Description copied from interface:CommonQueryContract
Bind the given argument to an ordinal query parameter.If the type of the parameter cannot be inferred from the context in which it occurs, use one of the forms which accepts a "type".
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceProcedureCall
- Specified by:
setParameter
in interfaceProcedureCallImplementor<R>
- Specified by:
setParameter
in interfacejakarta.persistence.Query
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQueryImplementor<R>
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfacejakarta.persistence.StoredProcedureQuery
- Specified by:
setParameter
in interfacejakarta.persistence.TypedQuery<R>
- Overrides:
setParameter
in classAbstractQuery<R>
- See Also:
CommonQueryContract.setParameter(int, Object, Class)
,CommonQueryContract.setParameter(int, Object, BindableType)
-
setParameter
public <P> ProcedureCallImplementor<R> setParameter(QueryParameter<P> parameter, P value, BindableType<P> type)
Description copied from interface:CommonQueryContract
Bind an argument to the query parameter represented by the givenQueryParameter
, using the givenBindableType
.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQueryImplementor<R>
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Overrides:
setParameter
in classAbstractQuery<R>
- Parameters:
parameter
- the query parameter mementovalue
- the argument, which might be nulltype
- aBindableType
representing the type of the parameter- Returns:
this
, for method chaining
-
setParameter
public <P> ProcedureCallImplementor<R> setParameter(String name, P value, BindableType<P> type)
Description copied from interface:CommonQueryContract
Bind the given argument to a named query parameter using the givenBindableType
.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQueryImplementor<R>
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Overrides:
setParameter
in classAbstractQuery<R>
-
setParameter
public <P> ProcedureCallImplementor<R> setParameter(int position, P value, BindableType<P> type)
Description copied from interface:CommonQueryContract
Bind the given argument to an ordinal query parameter using the givenBindableType
.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQueryImplementor<R>
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Overrides:
setParameter
in classAbstractQuery<R>
-
setParameter
public ProcedureCallImplementor<R> setParameter(jakarta.persistence.Parameter<Calendar> parameter, Calendar value, jakarta.persistence.TemporalType temporalPrecision)
Description copied from interface:Query
Query
override- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceProcedureCall
- Specified by:
setParameter
in interfaceProcedureCallImplementor<R>
- Specified by:
setParameter
in interfacejakarta.persistence.Query
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQueryImplementor<R>
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfacejakarta.persistence.StoredProcedureQuery
- Specified by:
setParameter
in interfacejakarta.persistence.TypedQuery<R>
- Overrides:
setParameter
in classAbstractQuery<R>
- See Also:
Query.setParameter(Parameter, Calendar, TemporalType)
-
setParameter
public ProcedureCallImplementor<R> setParameter(jakarta.persistence.Parameter<Date> parameter, Date value, jakarta.persistence.TemporalType temporalPrecision)
Description copied from interface:Query
Query
override- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceProcedureCall
- Specified by:
setParameter
in interfaceProcedureCallImplementor<R>
- Specified by:
setParameter
in interfacejakarta.persistence.Query
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQueryImplementor<R>
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfacejakarta.persistence.StoredProcedureQuery
- Specified by:
setParameter
in interfacejakarta.persistence.TypedQuery<R>
- Overrides:
setParameter
in classAbstractQuery<R>
- See Also:
Query.setParameter(Parameter, Date, TemporalType)
-
setParameter
public ProcedureCallImplementor<R> setParameter(String name, Calendar value, jakarta.persistence.TemporalType temporalPrecision)
Description copied from interface:Query
Query
override- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceProcedureCall
- Specified by:
setParameter
in interfaceProcedureCallImplementor<R>
- Specified by:
setParameter
in interfacejakarta.persistence.Query
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQueryImplementor<R>
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfacejakarta.persistence.StoredProcedureQuery
- Specified by:
setParameter
in interfacejakarta.persistence.TypedQuery<R>
- Overrides:
setParameter
in classAbstractQuery<R>
- See Also:
Query.setParameter(String, Calendar, TemporalType)
-
setParameter
public ProcedureCallImplementor<R> setParameter(String name, Date value, jakarta.persistence.TemporalType temporalPrecision)
Description copied from interface:Query
Query
override- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceProcedureCall
- Specified by:
setParameter
in interfaceProcedureCallImplementor<R>
- Specified by:
setParameter
in interfacejakarta.persistence.Query
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQueryImplementor<R>
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfacejakarta.persistence.StoredProcedureQuery
- Specified by:
setParameter
in interfacejakarta.persistence.TypedQuery<R>
- Overrides:
setParameter
in classAbstractQuery<R>
- See Also:
Query.setParameter(String, Date, TemporalType)
-
setParameter
public ProcedureCallImplementor<R> setParameter(int position, Calendar value, jakarta.persistence.TemporalType temporalPrecision)
Description copied from interface:Query
Query
override- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceProcedureCall
- Specified by:
setParameter
in interfaceProcedureCallImplementor<R>
- Specified by:
setParameter
in interfacejakarta.persistence.Query
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQueryImplementor<R>
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfacejakarta.persistence.StoredProcedureQuery
- Specified by:
setParameter
in interfacejakarta.persistence.TypedQuery<R>
- Overrides:
setParameter
in classAbstractQuery<R>
- See Also:
Query.setParameter(int, Calendar, TemporalType)
-
setParameter
public ProcedureCallImplementor<R> setParameter(int position, Date value, jakarta.persistence.TemporalType temporalPrecision)
Description copied from interface:Query
Query
override- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceProcedureCall
- Specified by:
setParameter
in interfaceProcedureCallImplementor<R>
- Specified by:
setParameter
in interfacejakarta.persistence.Query
- Specified by:
setParameter
in interfaceQuery<R>
- Specified by:
setParameter
in interfaceQueryImplementor<R>
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfacejakarta.persistence.StoredProcedureQuery
- Specified by:
setParameter
in interfacejakarta.persistence.TypedQuery<R>
- Overrides:
setParameter
in classAbstractQuery<R>
- See Also:
Query.setParameter(int, Date, TemporalType)
-
getResultStream
public Stream<R> getResultStream()
Description copied from interface:Query
Execute the query and return the query results as aStream
. If the query contains multiple items in the selection list, then by default each result in the stream is packaged in an array of typeObject[]
.The client should call
BaseStream.close()
after processing the stream so that resources are freed as soon as possible.- Specified by:
getResultStream
in interfacejakarta.persistence.Query
- Specified by:
getResultStream
in interfaceQuery<R>
- Specified by:
getResultStream
in interfaceSelectionQuery<R>
- Specified by:
getResultStream
in interfacejakarta.persistence.TypedQuery<R>
- Returns:
- The results as a
Stream
-
getResultSetMapping
public ResultSetMapping getResultSetMapping()
-
-