public class StoredProcedureQueryImpl extends QueryImpl
Constructor and Description |
---|
StoredProcedureQueryImpl(DatabaseQuery query,
EntityManagerImpl entityManager)
Create an EJBQueryImpl with a DatabaseQuery.
|
StoredProcedureQueryImpl(java.lang.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(java.util.List<java.lang.String> resultSetMappingNames,
StoredProcedureCall call,
java.util.Map<java.lang.String,java.lang.Object> hints,
java.lang.ClassLoader classLoader,
AbstractSession session)
Build a ResultSetMappingQuery from a sql result set mapping name and a
stored procedure call.
|
static DatabaseQuery |
buildResultSetMappingQuery(java.util.List<SQLResultSetMapping> resultSetMappings,
StoredProcedureCall call,
java.util.Map<java.lang.String,java.lang.Object> hints,
java.lang.ClassLoader classLoader,
AbstractSession session)
Build a ResultSetMappingQuery from the sql result set mappings given
a stored procedure call.
|
static DatabaseQuery |
buildStoredProcedureQuery(java.lang.Class resultClass,
StoredProcedureCall call,
java.util.Map<java.lang.String,java.lang.Object> hints,
java.lang.ClassLoader classLoader,
AbstractSession session)
Build a ReadAllQuery from a class and stored procedure call.
|
static DatabaseQuery |
buildStoredProcedureQuery(StoredProcedureCall call,
java.util.Map<java.lang.String,java.lang.Object> hints,
java.lang.ClassLoader classLoader,
AbstractSession session)
Build a ResultSetMappingQuery from a sql result set mapping name and a
stored procedure call.
|
static DatabaseQuery |
buildStoredProcedureQuery(java.lang.String sqlResultSetMappingName,
StoredProcedureCall call,
java.util.Map<java.lang.String,java.lang.Object> hints,
java.lang.ClassLoader classLoader,
AbstractSession session)
Build a ResultSetMappingQuery from a sql result set mapping name and a
stored procedure call.
|
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.
|
java.lang.Object |
getOutputParameterValue(int position)
Used to retrieve the values passed back from the procedure
through INOUT and OUT parameters.
|
java.lang.Object |
getOutputParameterValue(java.lang.String parameterName)
Used to retrieve the values passed back from the procedure
through INOUT and OUT parameters.
|
java.util.List |
getResultList()
Execute the query and return the query results as a List.
|
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.
|
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.
|
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.
|
executeUpdate, getDatabaseQuery, getDatabaseQueryInternal, getEntityManager, getFirstResult, getFlushMode, getHints, getLockMode, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, getSingleResult, getSupportedHints, isBound, setDatabaseQuery, setMaxResultsInternal, toString, unwrap
public StoredProcedureQueryImpl(DatabaseQuery query, EntityManagerImpl entityManager)
public StoredProcedureQueryImpl(java.lang.String name, EntityManagerImpl entityManager)
isNamedQuery
- determines whether to treat the queryDescription as jpql or a
query name.public static DatabaseQuery buildResultSetMappingNameQuery(java.util.List<java.lang.String> resultSetMappingNames, StoredProcedureCall call, java.util.Map<java.lang.String,java.lang.Object> hints, java.lang.ClassLoader classLoader, AbstractSession session)
public static DatabaseQuery buildResultSetMappingQuery(java.util.List<SQLResultSetMapping> resultSetMappings, StoredProcedureCall call, java.util.Map<java.lang.String,java.lang.Object> hints, java.lang.ClassLoader classLoader, AbstractSession session)
public static DatabaseQuery buildStoredProcedureQuery(java.lang.Class resultClass, StoredProcedureCall call, java.util.Map<java.lang.String,java.lang.Object> hints, java.lang.ClassLoader classLoader, AbstractSession session)
public static DatabaseQuery buildStoredProcedureQuery(StoredProcedureCall call, java.util.Map<java.lang.String,java.lang.Object> hints, java.lang.ClassLoader classLoader, AbstractSession session)
public static DatabaseQuery buildStoredProcedureQuery(java.lang.String sqlResultSetMappingName, StoredProcedureCall call, java.util.Map<java.lang.String,java.lang.Object> hints, java.lang.ClassLoader classLoader, AbstractSession session)
public boolean execute()
javax.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 java.lang.Object getOutputParameterValue(int position)
position
- parameter positionjava.lang.IllegalArgumentException
- if the position does
not correspond to a parameter of the query or is
not an INOUT or OUT parameterpublic java.lang.Object getOutputParameterValue(java.lang.String parameterName)
parameterName
- name of the parameter as registered or
specified in metadatajava.lang.IllegalArgumentException
- if the parameter name does
not correspond to a parameter of the query or is
not an INOUT or OUT parameterpublic java.util.List getResultList()
getResultList
in class QueryImpl
public int getUpdateCount()
javax.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()
javax.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 StoredProcedureQueryImpl setFirstResult(int startPosition)
setFirstResult
in class QueryImpl
start
- position of the first result, numbered from 0public StoredProcedureQueryImpl setFlushMode(javax.persistence.FlushModeType flushMode)
setFlushMode
in class QueryImpl
flushMode
- flush modepublic StoredProcedureQueryImpl setLockMode(javax.persistence.LockModeType lockMode)
setLockMode
in class QueryImpl
lockMode
- java.lang.IllegalStateException
- if not a Java Persistence query language SELECT querypublic StoredProcedureQueryImpl setMaxResults(int maxResult)
setMaxResults
in class QueryImpl
maxResult
- EclipseLink 2.4.2, "build v20130514-5956486" API Reference