public class StoredProcedureQueryImpl extends QueryImpl implements javax.persistence.StoredProcedureQuery
| Constructor and Description |
|---|
StoredProcedureQueryImpl(DatabaseQuery query,
EntityManagerImpl entityManager)
Create an EJBQueryImpl with a DatabaseQuery.
|
StoredProcedureQueryImpl(String name,
EntityManagerImpl entityManager)
Create an EJBQueryImpl with either a query name or an jpql string.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.
|
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.
|
javax.persistence.StoredProcedureQuery |
registerStoredProcedureParameter(int position,
Class type,
javax.persistence.ParameterMode mode)
Register a positional parameter.
|
javax.persistence.StoredProcedureQuery |
registerStoredProcedureParameter(String parameterName,
Class type,
javax.persistence.ParameterMode mode)
Register a named parameter.
|
StoredProcedureQueryImpl |
setFirstResult(int startPosition)
Set the position of the first result to retrieve.
|
StoredProcedureQueryImpl |
setFlushMode(javax.persistence.FlushModeType flushMode)
Set the flush mode type to be used for the query execution.
|
javax.persistence.StoredProcedureQuery |
setHint(String hintName,
Object value)
Set a query property or hint.
|
StoredProcedureQueryImpl |
setLockMode(javax.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.
|
javax.persistence.StoredProcedureQuery |
setParameter(int position,
Calendar value,
javax.persistence.TemporalType temporalType)
Bind an instance of java.util.Calendar to a positional parameter.
|
javax.persistence.StoredProcedureQuery |
setParameter(int position,
Date value,
javax.persistence.TemporalType temporalType)
Bind an instance of java.util.Date to a positional parameter.
|
javax.persistence.StoredProcedureQuery |
setParameter(int position,
Object value)
Bind an argument to a positional parameter.
|
javax.persistence.StoredProcedureQuery |
setParameter(javax.persistence.Parameter<Calendar> param,
Calendar value,
javax.persistence.TemporalType temporalType)
Bind an instance of java.util.Calendar to a Parameter object.
|
javax.persistence.StoredProcedureQuery |
setParameter(javax.persistence.Parameter<Date> param,
Date value,
javax.persistence.TemporalType temporalType)
Bind an instance of java.util.Date to a Parameter object.
|
<T> javax.persistence.StoredProcedureQuery |
setParameter(javax.persistence.Parameter<T> param,
T value)
Bind the value of a Parameter object.
|
javax.persistence.StoredProcedureQuery |
setParameter(String name,
Calendar value,
javax.persistence.TemporalType temporalType)
Bind an instance of java.util.Calendar to a named parameter.
|
javax.persistence.StoredProcedureQuery |
setParameter(String name,
Date value,
javax.persistence.TemporalType temporalType)
Bind an instance of java.util.Date to a named parameter.
|
javax.persistence.StoredProcedureQuery |
setParameter(String name,
Object value)
Bind an argument to a named parameter.
|
getDatabaseQuery, getDatabaseQueryInternal, getEntityManager, getFirstResult, getFlushMode, getHints, getLockMode, getMaxResults, getMaxResultsInternal, getParameter, getParameter, getParameter, getParameter, getParameterId, getParameters, getParameterValue, getParameterValue, getParameterValue, getSupportedHints, isBound, setDatabaseQuery, setMaxResultsInternal, toString, unwrappublic StoredProcedureQueryImpl(DatabaseQuery query, EntityManagerImpl entityManager)
public StoredProcedureQueryImpl(String name, EntityManagerImpl entityManager)
isNamedQuery - determines whether to treat the queryDescription as jpql or a
query name.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 javax.persistence.StoredProcedureQueryjavax.persistence.QueryTimeoutException - if the query execution exceeds the query
timeout value set and only the statement is rolled backjavax.persistence.PersistenceException - if the query execution exceeds the query
timeout value set and the transaction is rolled backpublic int executeUpdate()
executeUpdate in interface javax.persistence.QueryexecuteUpdate in interface javax.persistence.StoredProcedureQueryexecuteUpdate in class QueryImplpublic void finalize()
public Object getOutputParameterValue(int position)
getOutputParameterValue in interface javax.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 javax.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 javax.persistence.QuerygetResultList in interface javax.persistence.StoredProcedureQuerygetResultList in class QueryImplpublic Object getSingleResult()
getSingleResult in interface javax.persistence.QuerygetSingleResult in interface javax.persistence.StoredProcedureQuerygetSingleResult in class QueryImplpublic int getUpdateCount()
getUpdateCount in interface javax.persistence.StoredProcedureQueryjavax.persistence.QueryTimeoutException - if the query execution exceeds
the query timeout value set and only the statement is
rolled backjavax.persistence.PersistenceException - if the query execution exceeds
the query timeout value set and the transaction
is rolled backpublic boolean hasMoreResults()
hasMoreResults in interface javax.persistence.StoredProcedureQueryjavax.persistence.QueryTimeoutException - if the query execution exceeds the query
timeout value set and only the statement is rolled backjavax.persistence.PersistenceException - if the query execution exceeds the query
timeout value set and the transaction is rolled backpublic javax.persistence.StoredProcedureQuery registerStoredProcedureParameter(int position,
Class type,
javax.persistence.ParameterMode mode)
registerStoredProcedureParameter in interface javax.persistence.StoredProcedureQueryposition - parameter positiontype - type of the parametermode - parameter modepublic javax.persistence.StoredProcedureQuery registerStoredProcedureParameter(String parameterName, Class type, javax.persistence.ParameterMode mode)
registerStoredProcedureParameter in interface javax.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 javax.persistence.QuerysetFirstResult in class QueryImplstart - position of the first result, numbered from 0public StoredProcedureQueryImpl setFlushMode(javax.persistence.FlushModeType flushMode)
setFlushMode in interface javax.persistence.QuerysetFlushMode in interface javax.persistence.StoredProcedureQuerysetFlushMode in class QueryImplflushMode - flush modepublic javax.persistence.StoredProcedureQuery setHint(String hintName, Object value)
setHint in interface javax.persistence.QuerysetHint in interface javax.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(javax.persistence.LockModeType lockMode)
setLockMode in interface javax.persistence.QuerysetLockMode in class QueryImpllockMode - IllegalStateException - if not a Java Persistence query language SELECT querypublic StoredProcedureQueryImpl setMaxResults(int maxResult)
setMaxResults in interface javax.persistence.QuerysetMaxResults in class QueryImplmaxResult - public javax.persistence.StoredProcedureQuery setParameter(int position,
Calendar value,
javax.persistence.TemporalType temporalType)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.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 javax.persistence.StoredProcedureQuery setParameter(int position,
Date value,
javax.persistence.TemporalType temporalType)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.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 javax.persistence.StoredProcedureQuery setParameter(int position,
Object value)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.persistence.StoredProcedureQueryposition - value - IllegalArgumentException - if position does not correspond to a
positional parameter of the query or if the argument is of incorrect typepublic javax.persistence.StoredProcedureQuery setParameter(javax.persistence.Parameter<Calendar> param, Calendar value, javax.persistence.TemporalType temporalType)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.persistence.StoredProcedureQueryparam - value - temporalType - IllegalArgumentException - if the parameter does not correspond to
a parameter of the querypublic javax.persistence.StoredProcedureQuery setParameter(javax.persistence.Parameter<Date> param, Date value, javax.persistence.TemporalType temporalType)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.persistence.StoredProcedureQueryparam - value - temporalType - IllegalArgumentException - if the parameter does not correspond to
a parameter of the querypublic <T> javax.persistence.StoredProcedureQuery setParameter(javax.persistence.Parameter<T> param,
T value)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.persistence.StoredProcedureQueryparam - value - IllegalArgumentException - if the parameter does not correspond to
a parameter of the querypublic javax.persistence.StoredProcedureQuery setParameter(String name, Calendar value, javax.persistence.TemporalType temporalType)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.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 javax.persistence.StoredProcedureQuery setParameter(String name, Date value, javax.persistence.TemporalType temporalType)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.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 javax.persistence.StoredProcedureQuery setParameter(String name, Object value)
setParameter in interface javax.persistence.QuerysetParameter in interface javax.persistence.StoredProcedureQueryname - value - IllegalArgumentException - if the parameter name does not
correspond to a parameter of the query or if the argument is of incorrect
typeEclipseLink 2.6.3, "build v20160428-59c81c5" API Reference