public class StoredProcedureQueryImpl extends QueryImpl implements jakarta.persistence.StoredProcedureQuery
| Modifier and Type | Field and Description |
|---|---|
protected DatabaseCall |
executeCall |
protected int |
executeResultSetIndex |
protected Statement |
executeStatement |
protected boolean |
hasMoreResults |
protected boolean |
isOutputCursorResultSet |
protected int |
outputCursorIndex |
databaseQuery, entityManager, firstResultIndex, isShared, lockMode, maxResults, parameters, parameterValues, queryName, UNDEFINED| Modifier | Constructor and Description |
|---|---|
|
StoredProcedureQueryImpl(DatabaseQuery query,
EntityManagerImpl entityManager)
Create an StoredProcedureQueryImpl with a DatabaseQuery.
|
protected |
StoredProcedureQueryImpl(EntityManagerImpl entityManager)
Base constructor for StoredProcedureQueryImpl.
|
|
StoredProcedureQueryImpl(String name,
EntityManagerImpl entityManager)
Create an StoredProcedureQueryImpl with a query name.
|
| Modifier and Type | Method and Description |
|---|---|
protected List |
buildResultRecords(ResultSet resultSet)
Build the given result set into a list objects.
|
static DatabaseQuery |
buildResultSetMappingNameQuery(List<String> resultSetMappingNames,
StoredProcedureCall call)
Build a ResultSetMappingQuery from a sql result set mapping name and a
stored procedure call.
|
static DatabaseQuery |
buildResultSetMappingNameQuery(List<String> resultSetMappingNames,
StoredProcedureCall call,
Map<String,Object> hints,
ClassLoader classLoader,
AbstractSession session)
Build a ResultSetMappingQuery from a sql result set mapping name and a
stored procedure call.
|
static DatabaseQuery |
buildResultSetMappingQuery(List<SQLResultSetMapping> resultSetMappings,
StoredProcedureCall call)
Build a ResultSetMappingQuery from the sql result set mappings given
a stored procedure call.
|
static DatabaseQuery |
buildResultSetMappingQuery(List<SQLResultSetMapping> resultSetMappings,
StoredProcedureCall call,
Map<String,Object> hints,
ClassLoader classLoader,
AbstractSession session)
Build a ResultSetMappingQuery from the sql result set mappings given
a stored procedure call.
|
static DatabaseQuery |
buildStoredProcedureQuery(Class resultClass,
StoredProcedureCall call,
Map<String,Object> hints,
ClassLoader classLoader,
AbstractSession session)
Build a ReadAllQuery from a class and stored procedure call.
|
static DatabaseQuery |
buildStoredProcedureQuery(StoredProcedureCall call,
Map<String,Object> hints,
ClassLoader classLoader,
AbstractSession session)
Build a DataReadQuery with the stored procedure call given.
|
static DatabaseQuery |
buildStoredProcedureQuery(String sqlResultSetMappingName,
StoredProcedureCall call,
Map<String,Object> hints,
ClassLoader classLoader,
AbstractSession session)
Build a ResultSetMappingQuery from a sql result set mapping name and a
stored procedure call.
|
void |
close()
Call this method to close any open connections to the database.
|
boolean |
execute()
Returns 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 (from a stored procedure query).
|
void |
finalize()
Finalize method in case the query is not closed.
|
protected StoredProcedureCall |
getCall()
Return the stored procedure call associated with this query.
|
protected Map<String,jakarta.persistence.Parameter<?>> |
getInternalParameters()
Return the internal map of parameters.
|
Object |
getOutputParameterValue(int position)
Used to retrieve the values passed back from the procedure through INOUT
and OUT parameters.
|
Object |
getOutputParameterValue(String parameterName)
Used to retrieve the values passed back from the procedure through INOUT
and OUT parameters.
|
List |
getResultList()
Execute the query and return the query results as a List.
|
protected ResultSetMappingQuery |
getResultSetMappingQuery()
Return the ResultSetMappingQuery for this stored procedure query.
|
Object |
getSingleResult()
Execute the query and return the single query result.
|
int |
getUpdateCount()
Returns the update count or -1 if there is no pending result
or if the next result is not an update count.
|
boolean |
hasMoreResults()
Returns 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 boolean |
isValidCallableStatement()
Returns true if the execute statement for this query is 1) not null (i.e.
|
jakarta.persistence.StoredProcedureQuery |
registerStoredProcedureParameter(int position,
Class type,
jakarta.persistence.ParameterMode mode)
Register a positional parameter.
|
jakarta.persistence.StoredProcedureQuery |
registerStoredProcedureParameter(String parameterName,
Class type,
jakarta.persistence.ParameterMode mode)
Register a named parameter.
|
StoredProcedureQueryImpl |
setFirstResult(int startPosition)
Set the position of the first result to retrieve.
|
StoredProcedureQueryImpl |
setFlushMode(jakarta.persistence.FlushModeType flushMode)
Set the flush mode type to be used for the query execution.
|
jakarta.persistence.StoredProcedureQuery |
setHint(String hintName,
Object value)
Set a query property or hint.
|
StoredProcedureQueryImpl |
setLockMode(jakarta.persistence.LockModeType lockMode)
Set the lock mode type to be used for the query execution.
|
StoredProcedureQueryImpl |
setMaxResults(int maxResult)
Set the maximum number of results to retrieve.
|
jakarta.persistence.StoredProcedureQuery |
setParameter(int position,
Calendar value,
jakarta.persistence.TemporalType temporalType)
Bind an instance of java.util.Calendar to a positional parameter.
|
jakarta.persistence.StoredProcedureQuery |
setParameter(int position,
Date value,
jakarta.persistence.TemporalType temporalType)
Bind an instance of java.util.Date to a positional parameter.
|
jakarta.persistence.StoredProcedureQuery |
setParameter(int position,
Object value)
Bind an argument to a positional parameter.
|
jakarta.persistence.StoredProcedureQuery |
setParameter(jakarta.persistence.Parameter<Calendar> param,
Calendar value,
jakarta.persistence.TemporalType temporalType)
Bind an instance of java.util.Calendar to a Parameter object.
|
jakarta.persistence.StoredProcedureQuery |
setParameter(jakarta.persistence.Parameter<Date> param,
Date value,
jakarta.persistence.TemporalType temporalType)
Bind an instance of java.util.Date to a Parameter object.
|
<T> jakarta.persistence.StoredProcedureQuery |
setParameter(jakarta.persistence.Parameter<T> param,
T value)
Bind the value of a Parameter object.
|
jakarta.persistence.StoredProcedureQuery |
setParameter(String name,
Calendar value,
jakarta.persistence.TemporalType temporalType)
Bind an instance of java.util.Calendar to a named parameter.
|
jakarta.persistence.StoredProcedureQuery |
setParameter(String name,
Date value,
jakarta.persistence.TemporalType temporalType)
Bind an instance of java.util.Date to a named parameter.
|
jakarta.persistence.StoredProcedureQuery |
setParameter(String name,
Object value)
Bind an argument to a named parameter.
|
protected void |
setParameterInternal(String name,
Object value,
boolean isIndex)
Bind an argument to a named or indexed parameter.
|
applyArguments, applyHints, cloneSharedQuery, convertTemporalType, executeReadQuery, getActiveSession, getDatabaseQuery, getDatabaseQueryInternal, getDetailedException, getEntityManager, getFirstResult, getFlushMode, getHints, getLockMode, getMaxResults, getMaxResultsInternal, getParameter, getParameter, getParameter, getParameter, getParameterId, getParameters, getParameterValue, getParameterValue, getParameterValue, getSupportedHints, isBound, isFlushModeAUTO, isValidActualParameter, performPreQueryFlush, processParameters, propagateResultProperties, setAsDataModifyQuery, setAsSQLModifyQuery, setAsSQLReadQuery, setDatabaseQuery, setFirstResultInternal, setHintInternal, setMaxResultsInternal, setParameterInternal, setRollbackOnly, throwNonUniqueResultException, throwNoResultException, toString, unwrapprotected boolean hasMoreResults
protected DatabaseCall executeCall
protected Statement executeStatement
protected int executeResultSetIndex
protected int outputCursorIndex
protected boolean isOutputCursorResultSet
protected StoredProcedureQueryImpl(EntityManagerImpl entityManager)
public StoredProcedureQueryImpl(DatabaseQuery query, EntityManagerImpl entityManager)
public StoredProcedureQueryImpl(String name, EntityManagerImpl entityManager)
protected List buildResultRecords(ResultSet resultSet)
public static DatabaseQuery buildResultSetMappingNameQuery(List<String> resultSetMappingNames, StoredProcedureCall call)
public static DatabaseQuery buildResultSetMappingNameQuery(List<String> resultSetMappingNames, StoredProcedureCall call, Map<String,Object> hints, ClassLoader classLoader, AbstractSession session)
public static DatabaseQuery buildResultSetMappingQuery(List<SQLResultSetMapping> resultSetMappings, StoredProcedureCall call)
public static DatabaseQuery buildResultSetMappingQuery(List<SQLResultSetMapping> resultSetMappings, StoredProcedureCall call, Map<String,Object> hints, ClassLoader classLoader, AbstractSession session)
public static DatabaseQuery buildStoredProcedureQuery(Class resultClass, StoredProcedureCall call, Map<String,Object> hints, ClassLoader classLoader, AbstractSession session)
public static DatabaseQuery buildStoredProcedureQuery(StoredProcedureCall call, Map<String,Object> hints, ClassLoader classLoader, AbstractSession session)
public static DatabaseQuery buildStoredProcedureQuery(String sqlResultSetMappingName, StoredProcedureCall call, Map<String,Object> hints, ClassLoader classLoader, AbstractSession session)
public void close()
public boolean execute()
execute in interface jakarta.persistence.StoredProcedureQueryjakarta.persistence.QueryTimeoutException - if the query execution exceeds the query
timeout value set and only the statement is rolled backjakarta.persistence.PersistenceException - if the query execution exceeds the query
timeout value set and the transaction is rolled backpublic int executeUpdate()
executeUpdate in interface jakarta.persistence.QueryexecuteUpdate in interface jakarta.persistence.StoredProcedureQueryexecuteUpdate in class QueryImplpublic void finalize()
protected StoredProcedureCall getCall()
protected Map<String,jakarta.persistence.Parameter<?>> getInternalParameters()
getInternalParameters in class QueryImplpublic Object getOutputParameterValue(int position)
getOutputParameterValue in interface jakarta.persistence.StoredProcedureQueryposition - parameter positionIllegalArgumentException - if the position does not correspond to a
parameter of the query or is not an INOUT or OUT parameterpublic Object getOutputParameterValue(String parameterName)
getOutputParameterValue in interface jakarta.persistence.StoredProcedureQueryparameterName - name of the parameter as registered or specified in
metadataIllegalArgumentException - if the parameter name does not
correspond to a parameter of the query or is not an INOUT or OUT parameterpublic List getResultList()
getResultList in interface jakarta.persistence.QuerygetResultList in interface jakarta.persistence.StoredProcedureQuerygetResultList in class QueryImplprotected ResultSetMappingQuery getResultSetMappingQuery()
public Object getSingleResult()
getSingleResult in interface jakarta.persistence.QuerygetSingleResult in interface jakarta.persistence.StoredProcedureQuerygetSingleResult in class QueryImplpublic int getUpdateCount()
getUpdateCount in interface jakarta.persistence.StoredProcedureQueryjakarta.persistence.QueryTimeoutException - if the query execution exceeds
the query timeout value set and only the statement is
rolled backjakarta.persistence.PersistenceException - if the query execution exceeds
the query timeout value set and the transaction
is rolled backpublic boolean hasMoreResults()
hasMoreResults in interface jakarta.persistence.StoredProcedureQueryjakarta.persistence.QueryTimeoutException - if the query execution exceeds the query
timeout value set and only the statement is rolled backjakarta.persistence.PersistenceException - if the query execution exceeds the query
timeout value set and the transaction is rolled backprotected boolean isValidCallableStatement()
public jakarta.persistence.StoredProcedureQuery registerStoredProcedureParameter(int position,
Class type,
jakarta.persistence.ParameterMode mode)
registerStoredProcedureParameter in interface jakarta.persistence.StoredProcedureQueryposition - parameter positiontype - type of the parametermode - parameter modepublic jakarta.persistence.StoredProcedureQuery registerStoredProcedureParameter(String parameterName, Class type, jakarta.persistence.ParameterMode mode)
registerStoredProcedureParameter in interface jakarta.persistence.StoredProcedureQueryparameterName - name of the parameter as registered or
specified in metadatatype - type of the parametermode - parameter modepublic StoredProcedureQueryImpl setFirstResult(int startPosition)
setFirstResult in interface jakarta.persistence.QuerysetFirstResult in class QueryImplstartPosition - position of the first result, numbered from 0public StoredProcedureQueryImpl setFlushMode(jakarta.persistence.FlushModeType flushMode)
setFlushMode in interface jakarta.persistence.QuerysetFlushMode in interface jakarta.persistence.StoredProcedureQuerysetFlushMode in class QueryImplflushMode - flush modepublic jakarta.persistence.StoredProcedureQuery setHint(String hintName, Object value)
setHint in interface jakarta.persistence.QuerysetHint in interface jakarta.persistence.StoredProcedureQueryhintName - name of the property or hintvalue - value for the property or hintIllegalArgumentException - if the second argument is not valid for
the implementationpublic StoredProcedureQueryImpl setLockMode(jakarta.persistence.LockModeType lockMode)
setLockMode in interface jakarta.persistence.QuerysetLockMode in class QueryImpllockMode - IllegalStateException - if not a Java Persistence query language SELECT querypublic StoredProcedureQueryImpl setMaxResults(int maxResult)
setMaxResults in interface jakarta.persistence.QuerysetMaxResults in class QueryImplmaxResult - public jakarta.persistence.StoredProcedureQuery setParameter(int position,
Calendar value,
jakarta.persistence.TemporalType temporalType)
setParameter in interface jakarta.persistence.QuerysetParameter in interface jakarta.persistence.StoredProcedureQueryposition - value - temporalType - IllegalArgumentException - if position does not correspond to a
positional parameter of the query or if the value argument is of
incorrect typepublic jakarta.persistence.StoredProcedureQuery setParameter(int position,
Date value,
jakarta.persistence.TemporalType temporalType)
setParameter in interface jakarta.persistence.QuerysetParameter in interface jakarta.persistence.StoredProcedureQueryposition - value - temporalType - IllegalArgumentException - if position does not correspond to a
positional parameter of the query or if the value argument is of
incorrect typepublic jakarta.persistence.StoredProcedureQuery setParameter(int position,
Object value)
setParameter in interface jakarta.persistence.QuerysetParameter in interface jakarta.persistence.StoredProcedureQueryposition - value - IllegalArgumentException - if position does not correspond to a
positional parameter of the query or if the argument is of incorrect typepublic jakarta.persistence.StoredProcedureQuery setParameter(jakarta.persistence.Parameter<Calendar> param, Calendar value, jakarta.persistence.TemporalType temporalType)
setParameter in interface jakarta.persistence.QuerysetParameter in interface jakarta.persistence.StoredProcedureQueryparam - value - temporalType - IllegalArgumentException - if the parameter does not correspond to
a parameter of the querypublic jakarta.persistence.StoredProcedureQuery setParameter(jakarta.persistence.Parameter<Date> param, Date value, jakarta.persistence.TemporalType temporalType)
setParameter in interface jakarta.persistence.QuerysetParameter in interface jakarta.persistence.StoredProcedureQueryparam - value - temporalType - IllegalArgumentException - if the parameter does not correspond to
a parameter of the querypublic <T> jakarta.persistence.StoredProcedureQuery setParameter(jakarta.persistence.Parameter<T> param,
T value)
setParameter in interface jakarta.persistence.QuerysetParameter in interface jakarta.persistence.StoredProcedureQueryparam - value - IllegalArgumentException - if the parameter does not correspond to
a parameter of the querypublic jakarta.persistence.StoredProcedureQuery setParameter(String name, Calendar value, jakarta.persistence.TemporalType temporalType)
setParameter in interface jakarta.persistence.QuerysetParameter in interface jakarta.persistence.StoredProcedureQueryname - value - temporalType - IllegalArgumentException - if the parameter name does not
correspond to a parameter of the query or if the value argument is of
incorrect typepublic jakarta.persistence.StoredProcedureQuery setParameter(String name, Date value, jakarta.persistence.TemporalType temporalType)
setParameter in interface jakarta.persistence.QuerysetParameter in interface jakarta.persistence.StoredProcedureQueryname - value - temporalType - IllegalArgumentException - if the parameter name does not
correspond to a parameter of the query or if the value argument is of
incorrect typepublic jakarta.persistence.StoredProcedureQuery setParameter(String name, Object value)
setParameter in interface jakarta.persistence.QuerysetParameter in interface jakarta.persistence.StoredProcedureQueryname - value - IllegalArgumentException - if the parameter name does not
correspond to a parameter of the query or if the argument is of incorrect
typeprotected void setParameterInternal(String name, Object value, boolean isIndex)
setParameterInternal in class QueryImplname - the parameter namevalue - to bindisIndex - defines if index or namedCopyright © 2007–2021 Eclipse.org - EclipseLink Project. All rights reserved.