public class StoredProcedureQueryImpl extends Object implements javax.persistence.StoredProcedureQuery
stored procedure query
differs from other query types because it may return
more than one result set, apart from an optional update count, whereas the traditional query processing in OpenJPA
via the abstractions of ResultObjectProvider
and Result
assumed that a query will return its
result in a single list.
callback object
that can be used to callback to OpenJPA kernel to get a series of
results via the traditional result processing pathway.Constructor and Description |
---|
StoredProcedureQueryImpl(String procedureName,
MultiQueryMetaData meta,
QueryImpl<?> delegate)
Construct a query for executing a Stored Procedure.
|
Modifier and Type | Method and Description |
---|---|
boolean |
execute()
Executes this receiver by delegation to the underlying executable query.
|
int |
executeUpdate() |
OpenJPAQuery<?> |
getDelegate()
Gets the facade delegate that manages bind parameters on behalf of this receiver.
|
Query |
getExecutableQuery()
Gets the kernel delegate that is handles actual execution on behalf of this receiver.
|
int |
getFirstResult() |
javax.persistence.FlushModeType |
getFlushMode() |
Map<String,Object> |
getHints() |
javax.persistence.LockModeType |
getLockMode() |
int |
getMaxResults() |
Object |
getOutputParameterValue(int position) |
Object |
getOutputParameterValue(String parameterName) |
javax.persistence.Parameter<?> |
getParameter(int position) |
<T> javax.persistence.Parameter<T> |
getParameter(int position,
Class<T> type) |
javax.persistence.Parameter<?> |
getParameter(String name) |
<T> javax.persistence.Parameter<T> |
getParameter(String name,
Class<T> type) |
Set<javax.persistence.Parameter<?>> |
getParameters() |
Object |
getParameterValue(int position) |
<T> T |
getParameterValue(javax.persistence.Parameter<T> param) |
Object |
getParameterValue(String name) |
List |
getResultList() |
Object |
getSingleResult() |
int |
getUpdateCount() |
boolean |
hasMoreResults() |
boolean |
isBound(javax.persistence.Parameter<?> param) |
javax.persistence.StoredProcedureQuery |
registerStoredProcedureParameter(int position,
Class type,
javax.persistence.ParameterMode mode) |
javax.persistence.StoredProcedureQuery |
registerStoredProcedureParameter(String name,
Class type,
javax.persistence.ParameterMode mode) |
javax.persistence.Query |
setFirstResult(int startPosition) |
javax.persistence.StoredProcedureQuery |
setFlushMode(javax.persistence.FlushModeType flushMode) |
javax.persistence.StoredProcedureQuery |
setHint(String hintName,
Object value) |
javax.persistence.Query |
setLockMode(javax.persistence.LockModeType lockMode) |
javax.persistence.Query |
setMaxResults(int maxResult) |
javax.persistence.StoredProcedureQuery |
setParameter(int position,
Calendar value,
javax.persistence.TemporalType temporalType) |
javax.persistence.StoredProcedureQuery |
setParameter(int position,
Date value,
javax.persistence.TemporalType temporalType) |
javax.persistence.StoredProcedureQuery |
setParameter(int position,
Object value) |
javax.persistence.StoredProcedureQuery |
setParameter(javax.persistence.Parameter<Calendar> param,
Calendar cal,
javax.persistence.TemporalType temporalType) |
javax.persistence.StoredProcedureQuery |
setParameter(javax.persistence.Parameter<Date> param,
Date value,
javax.persistence.TemporalType temporalType) |
<T> javax.persistence.StoredProcedureQuery |
setParameter(javax.persistence.Parameter<T> param,
T value) |
javax.persistence.StoredProcedureQuery |
setParameter(String name,
Calendar cal,
javax.persistence.TemporalType temporalType) |
javax.persistence.StoredProcedureQuery |
setParameter(String name,
Date date,
javax.persistence.TemporalType temporalType) |
javax.persistence.StoredProcedureQuery |
setParameter(String name,
Object value) |
String |
toString() |
<T> T |
unwrap(Class<T> cls) |
public StoredProcedureQueryImpl(String procedureName, MultiQueryMetaData meta, QueryImpl<?> delegate)
procedureName
- name of the database stored procedure.meta
- delegate
- the delegate which manages bind parameters on behalf of thispublic OpenJPAQuery<?> getDelegate()
public Query getExecutableQuery()
public boolean execute()
execute
in interface javax.persistence.StoredProcedureQuery
public List getResultList()
getResultList
in interface javax.persistence.Query
getResultList
in interface javax.persistence.StoredProcedureQuery
public Object getSingleResult()
getSingleResult
in interface javax.persistence.Query
getSingleResult
in interface javax.persistence.StoredProcedureQuery
public boolean hasMoreResults()
hasMoreResults
in interface javax.persistence.StoredProcedureQuery
public int getUpdateCount()
getUpdateCount
in interface javax.persistence.StoredProcedureQuery
public int executeUpdate()
executeUpdate
in interface javax.persistence.Query
executeUpdate
in interface javax.persistence.StoredProcedureQuery
public <T> javax.persistence.Parameter<T> getParameter(String name, Class<T> type)
getParameter
in interface javax.persistence.Query
public <T> javax.persistence.Parameter<T> getParameter(int position, Class<T> type)
getParameter
in interface javax.persistence.Query
public boolean isBound(javax.persistence.Parameter<?> param)
isBound
in interface javax.persistence.Query
public <T> T getParameterValue(javax.persistence.Parameter<T> param)
getParameterValue
in interface javax.persistence.Query
public <T> T unwrap(Class<T> cls)
unwrap
in interface javax.persistence.Query
public <T> javax.persistence.StoredProcedureQuery setParameter(javax.persistence.Parameter<T> param, T value)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.StoredProcedureQuery
public javax.persistence.StoredProcedureQuery setParameter(javax.persistence.Parameter<Calendar> param, Calendar cal, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.StoredProcedureQuery
public javax.persistence.StoredProcedureQuery setParameter(javax.persistence.Parameter<Date> param, Date value, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.StoredProcedureQuery
public javax.persistence.StoredProcedureQuery registerStoredProcedureParameter(int position, Class type, javax.persistence.ParameterMode mode)
registerStoredProcedureParameter
in interface javax.persistence.StoredProcedureQuery
public javax.persistence.StoredProcedureQuery registerStoredProcedureParameter(String name, Class type, javax.persistence.ParameterMode mode)
registerStoredProcedureParameter
in interface javax.persistence.StoredProcedureQuery
public Object getOutputParameterValue(int position)
getOutputParameterValue
in interface javax.persistence.StoredProcedureQuery
public Object getOutputParameterValue(String parameterName)
getOutputParameterValue
in interface javax.persistence.StoredProcedureQuery
public javax.persistence.Query setMaxResults(int maxResult)
setMaxResults
in interface javax.persistence.Query
public int getMaxResults()
getMaxResults
in interface javax.persistence.Query
public javax.persistence.Query setFirstResult(int startPosition)
setFirstResult
in interface javax.persistence.Query
public int getFirstResult()
getFirstResult
in interface javax.persistence.Query
public Map<String,Object> getHints()
getHints
in interface javax.persistence.Query
public Set<javax.persistence.Parameter<?>> getParameters()
getParameters
in interface javax.persistence.Query
public javax.persistence.Parameter<?> getParameter(String name)
getParameter
in interface javax.persistence.Query
public javax.persistence.Parameter<?> getParameter(int position)
getParameter
in interface javax.persistence.Query
public Object getParameterValue(String name)
getParameterValue
in interface javax.persistence.Query
public Object getParameterValue(int position)
getParameterValue
in interface javax.persistence.Query
public javax.persistence.FlushModeType getFlushMode()
getFlushMode
in interface javax.persistence.Query
public javax.persistence.Query setLockMode(javax.persistence.LockModeType lockMode)
setLockMode
in interface javax.persistence.Query
public javax.persistence.LockModeType getLockMode()
getLockMode
in interface javax.persistence.Query
public javax.persistence.StoredProcedureQuery setHint(String hintName, Object value)
setHint
in interface javax.persistence.Query
setHint
in interface javax.persistence.StoredProcedureQuery
public javax.persistence.StoredProcedureQuery setParameter(String name, Object value)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.StoredProcedureQuery
public javax.persistence.StoredProcedureQuery setParameter(String name, Calendar cal, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.StoredProcedureQuery
public javax.persistence.StoredProcedureQuery setParameter(String name, Date date, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.StoredProcedureQuery
public javax.persistence.StoredProcedureQuery setParameter(int position, Object value)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.StoredProcedureQuery
public javax.persistence.StoredProcedureQuery setParameter(int position, Calendar value, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.StoredProcedureQuery
public javax.persistence.StoredProcedureQuery setParameter(int position, Date value, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.StoredProcedureQuery
public javax.persistence.StoredProcedureQuery setFlushMode(javax.persistence.FlushModeType flushMode)
setFlushMode
in interface javax.persistence.Query
setFlushMode
in interface javax.persistence.StoredProcedureQuery
Copyright © 2006–2019 Apache Software Foundation. All rights reserved.