Class StoredProcedureQueryImpl
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.QueryImpl
-
- org.eclipse.persistence.internal.jpa.StoredProcedureQueryImpl
-
- All Implemented Interfaces:
javax.persistence.Query,javax.persistence.StoredProcedureQuery
public class StoredProcedureQueryImpl extends QueryImpl implements javax.persistence.StoredProcedureQuery
Concrete JPA query class. The JPA query wraps a StoredProcesureQuery which is executed.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.eclipse.persistence.internal.databaseaccess.DatabaseCallexecuteCallprotected intexecuteResultSetIndexprotected java.sql.StatementexecuteStatementprotected booleanhasMoreResultsprotected booleanisOutputCursorResultSetprotected intoutputCursorIndex-
Fields inherited from class org.eclipse.persistence.internal.jpa.QueryImpl
databaseQuery, entityManager, firstResultIndex, isShared, lockMode, maxResults, parameters, parameterValues, queryName, UNDEFINED
-
-
Constructor Summary
Constructors Modifier Constructor Description StoredProcedureQueryImpl(java.lang.String name, EntityManagerImpl entityManager)Create an StoredProcedureQueryImpl with a query name.protectedStoredProcedureQueryImpl(EntityManagerImpl entityManager)Base constructor for StoredProcedureQueryImpl.StoredProcedureQueryImpl(org.eclipse.persistence.queries.DatabaseQuery query, EntityManagerImpl entityManager)Create an StoredProcedureQueryImpl with a DatabaseQuery.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.ListbuildResultRecords(java.sql.ResultSet resultSet)Build the given result set into a list objects.static org.eclipse.persistence.queries.DatabaseQuerybuildResultSetMappingNameQuery(java.util.List<java.lang.String> resultSetMappingNames, org.eclipse.persistence.queries.StoredProcedureCall call)Build a ResultSetMappingQuery from a sql result set mapping name and a stored procedure call.static org.eclipse.persistence.queries.DatabaseQuerybuildResultSetMappingNameQuery(java.util.List<java.lang.String> resultSetMappingNames, org.eclipse.persistence.queries.StoredProcedureCall call, java.util.Map<java.lang.String,java.lang.Object> hints, java.lang.ClassLoader classLoader, org.eclipse.persistence.internal.sessions.AbstractSession session)Build a ResultSetMappingQuery from a sql result set mapping name and a stored procedure call.static org.eclipse.persistence.queries.DatabaseQuerybuildResultSetMappingQuery(java.util.List<org.eclipse.persistence.queries.SQLResultSetMapping> resultSetMappings, org.eclipse.persistence.queries.StoredProcedureCall call)Build a ResultSetMappingQuery from the sql result set mappings given a stored procedure call.static org.eclipse.persistence.queries.DatabaseQuerybuildResultSetMappingQuery(java.util.List<org.eclipse.persistence.queries.SQLResultSetMapping> resultSetMappings, org.eclipse.persistence.queries.StoredProcedureCall call, java.util.Map<java.lang.String,java.lang.Object> hints, java.lang.ClassLoader classLoader, org.eclipse.persistence.internal.sessions.AbstractSession session)Build a ResultSetMappingQuery from the sql result set mappings given a stored procedure call.static org.eclipse.persistence.queries.DatabaseQuerybuildStoredProcedureQuery(java.lang.Class resultClass, org.eclipse.persistence.queries.StoredProcedureCall call, java.util.Map<java.lang.String,java.lang.Object> hints, java.lang.ClassLoader classLoader, org.eclipse.persistence.internal.sessions.AbstractSession session)Build a ReadAllQuery from a class and stored procedure call.static org.eclipse.persistence.queries.DatabaseQuerybuildStoredProcedureQuery(java.lang.String sqlResultSetMappingName, org.eclipse.persistence.queries.StoredProcedureCall call, java.util.Map<java.lang.String,java.lang.Object> hints, java.lang.ClassLoader classLoader, org.eclipse.persistence.internal.sessions.AbstractSession session)Build a ResultSetMappingQuery from a sql result set mapping name and a stored procedure call.static org.eclipse.persistence.queries.DatabaseQuerybuildStoredProcedureQuery(org.eclipse.persistence.queries.StoredProcedureCall call, java.util.Map<java.lang.String,java.lang.Object> hints, java.lang.ClassLoader classLoader, org.eclipse.persistence.internal.sessions.AbstractSession session)Build a DataReadQuery with the stored procedure call given.voidclose()Call this method to close any open connections to the database.booleanexecute()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.intexecuteUpdate()Execute an update or delete statement (from a stored procedure query).voidfinalize()Finalize method in case the query is not closed.protected org.eclipse.persistence.queries.StoredProcedureCallgetCall()Return the stored procedure call associated with this query.protected java.util.Map<java.lang.String,javax.persistence.Parameter<?>>getInternalParameters()Return the internal map of parameters.java.lang.ObjectgetOutputParameterValue(int position)Used to retrieve the values passed back from the procedure through INOUT and OUT parameters.java.lang.ObjectgetOutputParameterValue(java.lang.String parameterName)Used to retrieve the values passed back from the procedure through INOUT and OUT parameters.java.util.ListgetResultList()Execute the query and return the query results as a List.protected org.eclipse.persistence.queries.ResultSetMappingQuerygetResultSetMappingQuery()Return the ResultSetMappingQuery for this stored procedure query.java.lang.ObjectgetSingleResult()Execute the query and return the single query result.intgetUpdateCount()Returns the update count or -1 if there is no pending result or if the next result is not an update count.booleanhasMoreResults()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 booleanisValidCallableStatement()Returns true if the execute statement for this query is 1) not null (i.e.javax.persistence.StoredProcedureQueryregisterStoredProcedureParameter(int position, java.lang.Class type, javax.persistence.ParameterMode mode)Register a positional parameter.javax.persistence.StoredProcedureQueryregisterStoredProcedureParameter(java.lang.String parameterName, java.lang.Class type, javax.persistence.ParameterMode mode)Register a named parameter.StoredProcedureQueryImplsetFirstResult(int startPosition)Set the position of the first result to retrieve.StoredProcedureQueryImplsetFlushMode(javax.persistence.FlushModeType flushMode)Set the flush mode type to be used for the query execution.javax.persistence.StoredProcedureQuerysetHint(java.lang.String hintName, java.lang.Object value)Set a query property or hint.StoredProcedureQueryImplsetLockMode(javax.persistence.LockModeType lockMode)Set the lock mode type to be used for the query execution.StoredProcedureQueryImplsetMaxResults(int maxResult)Set the maximum number of results to retrieve.javax.persistence.StoredProcedureQuerysetParameter(int position, java.lang.Object value)Bind an argument to a positional parameter.javax.persistence.StoredProcedureQuerysetParameter(int position, java.util.Calendar value, javax.persistence.TemporalType temporalType)Bind an instance of java.util.Calendar to a positional parameter.javax.persistence.StoredProcedureQuerysetParameter(int position, java.util.Date value, javax.persistence.TemporalType temporalType)Bind an instance of java.util.Date to a positional parameter.javax.persistence.StoredProcedureQuerysetParameter(java.lang.String name, java.lang.Object value)Bind an argument to a named parameter.javax.persistence.StoredProcedureQuerysetParameter(java.lang.String name, java.util.Calendar value, javax.persistence.TemporalType temporalType)Bind an instance of java.util.Calendar to a named parameter.javax.persistence.StoredProcedureQuerysetParameter(java.lang.String name, java.util.Date value, javax.persistence.TemporalType temporalType)Bind an instance of java.util.Date to a named parameter.javax.persistence.StoredProcedureQuerysetParameter(javax.persistence.Parameter<java.util.Calendar> param, java.util.Calendar value, javax.persistence.TemporalType temporalType)Bind an instance of java.util.Calendar to a Parameter object.javax.persistence.StoredProcedureQuerysetParameter(javax.persistence.Parameter<java.util.Date> param, java.util.Date value, javax.persistence.TemporalType temporalType)Bind an instance of java.util.Date to a Parameter object.<T> javax.persistence.StoredProcedureQuerysetParameter(javax.persistence.Parameter<T> param, T value)Bind the value of a Parameter object.protected voidsetParameterInternal(java.lang.String name, java.lang.Object value, boolean isIndex)Bind an argument to a named or indexed parameter.-
Methods inherited from class org.eclipse.persistence.internal.jpa.QueryImpl
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, unwrap
-
-
-
-
Field Detail
-
hasMoreResults
protected boolean hasMoreResults
-
executeCall
protected org.eclipse.persistence.internal.databaseaccess.DatabaseCall executeCall
-
executeStatement
protected java.sql.Statement executeStatement
-
executeResultSetIndex
protected int executeResultSetIndex
-
outputCursorIndex
protected int outputCursorIndex
-
isOutputCursorResultSet
protected boolean isOutputCursorResultSet
-
-
Constructor Detail
-
StoredProcedureQueryImpl
protected StoredProcedureQueryImpl(EntityManagerImpl entityManager)
Base constructor for StoredProcedureQueryImpl. Initializes basic variables.
-
StoredProcedureQueryImpl
public StoredProcedureQueryImpl(org.eclipse.persistence.queries.DatabaseQuery query, EntityManagerImpl entityManager)Create an StoredProcedureQueryImpl with a DatabaseQuery.
-
StoredProcedureQueryImpl
public StoredProcedureQueryImpl(java.lang.String name, EntityManagerImpl entityManager)Create an StoredProcedureQueryImpl with a query name.
-
-
Method Detail
-
buildResultRecords
protected java.util.List buildResultRecords(java.sql.ResultSet resultSet)
Build the given result set into a list objects. Assumes there is an execute call available and therefore should not be called unless an execute statement was issued by the user.
-
buildResultSetMappingNameQuery
public static org.eclipse.persistence.queries.DatabaseQuery buildResultSetMappingNameQuery(java.util.List<java.lang.String> resultSetMappingNames, org.eclipse.persistence.queries.StoredProcedureCall call)Build a ResultSetMappingQuery from a sql result set mapping name and a stored procedure call. This is called from a named stored procedure that employs result set mapping name(s) which should be available from the session.
-
buildResultSetMappingNameQuery
public static org.eclipse.persistence.queries.DatabaseQuery buildResultSetMappingNameQuery(java.util.List<java.lang.String> resultSetMappingNames, org.eclipse.persistence.queries.StoredProcedureCall call, java.util.Map<java.lang.String,java.lang.Object> hints, java.lang.ClassLoader classLoader, org.eclipse.persistence.internal.sessions.AbstractSession session)Build a ResultSetMappingQuery from a sql result set mapping name and a stored procedure call. This is called from a named stored procedure that employs result set mapping name(s) which should be available from the session.
-
buildResultSetMappingQuery
public static org.eclipse.persistence.queries.DatabaseQuery buildResultSetMappingQuery(java.util.List<org.eclipse.persistence.queries.SQLResultSetMapping> resultSetMappings, org.eclipse.persistence.queries.StoredProcedureCall call)Build a ResultSetMappingQuery from the sql result set mappings given a stored procedure call. This is called from a named stored procedure query that employs result class name(s). The resultSetMappings are build from these class name(s) and are not available from the session.
-
buildResultSetMappingQuery
public static org.eclipse.persistence.queries.DatabaseQuery buildResultSetMappingQuery(java.util.List<org.eclipse.persistence.queries.SQLResultSetMapping> resultSetMappings, org.eclipse.persistence.queries.StoredProcedureCall call, java.util.Map<java.lang.String,java.lang.Object> hints, java.lang.ClassLoader classLoader, org.eclipse.persistence.internal.sessions.AbstractSession session)Build a ResultSetMappingQuery from the sql result set mappings given a stored procedure call. This is called from a named stored procedure query that employs result class name(s). The resultSetMappings are build from these class name(s) and are not available from the session.
-
buildStoredProcedureQuery
public static org.eclipse.persistence.queries.DatabaseQuery buildStoredProcedureQuery(java.lang.Class resultClass, org.eclipse.persistence.queries.StoredProcedureCall call, java.util.Map<java.lang.String,java.lang.Object> hints, java.lang.ClassLoader classLoader, org.eclipse.persistence.internal.sessions.AbstractSession session)Build a ReadAllQuery from a class and stored procedure call.
-
buildStoredProcedureQuery
public static org.eclipse.persistence.queries.DatabaseQuery buildStoredProcedureQuery(org.eclipse.persistence.queries.StoredProcedureCall call, java.util.Map<java.lang.String,java.lang.Object> hints, java.lang.ClassLoader classLoader, org.eclipse.persistence.internal.sessions.AbstractSession session)Build a DataReadQuery with the stored procedure call given.
-
buildStoredProcedureQuery
public static org.eclipse.persistence.queries.DatabaseQuery buildStoredProcedureQuery(java.lang.String sqlResultSetMappingName, org.eclipse.persistence.queries.StoredProcedureCall call, java.util.Map<java.lang.String,java.lang.Object> hints, java.lang.ClassLoader classLoader, org.eclipse.persistence.internal.sessions.AbstractSession session)Build a ResultSetMappingQuery from a sql result set mapping name and a stored procedure call.
-
close
public void close()
Call this method to close any open connections to the database.
-
execute
public 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.- Specified by:
executein interfacejavax.persistence.StoredProcedureQuery- Returns:
- true if first result corresponds to result set
- Throws:
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 back
-
executeUpdate
public int executeUpdate()
Execute an update or delete statement (from a stored procedure query).- Specified by:
executeUpdatein interfacejavax.persistence.Query- Specified by:
executeUpdatein interfacejavax.persistence.StoredProcedureQuery- Overrides:
executeUpdatein classQueryImpl- Returns:
- the number of entities updated or deleted
-
finalize
public void finalize()
Finalize method in case the query is not closed.- Overrides:
finalizein classjava.lang.Object
-
getCall
protected org.eclipse.persistence.queries.StoredProcedureCall getCall()
Return the stored procedure call associated with this query.
-
getInternalParameters
protected java.util.Map<java.lang.String,javax.persistence.Parameter<?>> getInternalParameters()
Return the internal map of parameters.- Overrides:
getInternalParametersin classQueryImpl
-
getOutputParameterValue
public java.lang.Object getOutputParameterValue(int position)
Used to retrieve the values passed back from the procedure through INOUT and OUT parameters. For portability, all results corresponding to result sets and update counts must be retrieved before the values of output parameters.- Specified by:
getOutputParameterValuein interfacejavax.persistence.StoredProcedureQuery- Parameters:
position- parameter position- Returns:
- the result that is passed back through the parameter
- Throws:
java.lang.IllegalArgumentException- if the position does not correspond to a parameter of the query or is not an INOUT or OUT parameter
-
getOutputParameterValue
public java.lang.Object getOutputParameterValue(java.lang.String parameterName)
Used to retrieve the values passed back from the procedure through INOUT and OUT parameters. For portability, all results corresponding to result sets and update counts must be retrieved before the values of output parameters.- Specified by:
getOutputParameterValuein interfacejavax.persistence.StoredProcedureQuery- Parameters:
parameterName- name of the parameter as registered or specified in metadata- Returns:
- the result that is passed back through the parameter
- Throws:
java.lang.IllegalArgumentException- if the parameter name does not correspond to a parameter of the query or is not an INOUT or OUT parameter
-
getResultList
public java.util.List getResultList()
Execute the query and return the query results as a List.- Specified by:
getResultListin interfacejavax.persistence.Query- Specified by:
getResultListin interfacejavax.persistence.StoredProcedureQuery- Overrides:
getResultListin classQueryImpl- Returns:
- a list of the results
-
getResultSetMappingQuery
protected org.eclipse.persistence.queries.ResultSetMappingQuery getResultSetMappingQuery()
Return the ResultSetMappingQuery for this stored procedure query. NOTE: Methods assumes associated database query is a ResultSetMappingQuery.
-
getSingleResult
public java.lang.Object getSingleResult()
Execute the query and return the single query result.- Specified by:
getSingleResultin interfacejavax.persistence.Query- Specified by:
getSingleResultin interfacejavax.persistence.StoredProcedureQuery- Overrides:
getSingleResultin classQueryImpl- Returns:
- a single result object.
-
getUpdateCount
public int getUpdateCount()
Returns the update count or -1 if there is no pending result or if the next result is not an update count.- Specified by:
getUpdateCountin interfacejavax.persistence.StoredProcedureQuery- Returns:
- update count or -1 if there is no pending result or if the next result is not an update count
- Throws:
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 back
-
hasMoreResults
public 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.- Specified by:
hasMoreResultsin interfacejavax.persistence.StoredProcedureQuery- Returns:
- true if next result corresponds to result set
- Throws:
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 back
-
isValidCallableStatement
protected boolean isValidCallableStatement()
Returns true if the execute statement for this query is 1) not null (i.e. query has been executed and 2) is an instance of callable statement, meaning there are out parameters associated with it.
-
registerStoredProcedureParameter
public javax.persistence.StoredProcedureQuery registerStoredProcedureParameter(int position, java.lang.Class type, javax.persistence.ParameterMode mode)Register a positional parameter. All positional parameters must be registered.- Specified by:
registerStoredProcedureParameterin interfacejavax.persistence.StoredProcedureQuery- Parameters:
position- parameter positiontype- type of the parametermode- parameter mode- Returns:
- the same query instance
-
registerStoredProcedureParameter
public javax.persistence.StoredProcedureQuery registerStoredProcedureParameter(java.lang.String parameterName, java.lang.Class type, javax.persistence.ParameterMode mode)Register a named parameter. When using parameter names, all parameters must be registered in the order in which they occur in the parameter list of the stored procedure.- Specified by:
registerStoredProcedureParameterin interfacejavax.persistence.StoredProcedureQuery- Parameters:
parameterName- name of the parameter as registered or specified in metadatatype- type of the parametermode- parameter mode- Returns:
- the same query instance
-
setFirstResult
public StoredProcedureQueryImpl setFirstResult(int startPosition)
Set the position of the first result to retrieve.- Specified by:
setFirstResultin interfacejavax.persistence.Query- Overrides:
setFirstResultin classQueryImpl- Parameters:
startPosition- position of the first result, numbered from 0- Returns:
- the same query instance
-
setFlushMode
public StoredProcedureQueryImpl setFlushMode(javax.persistence.FlushModeType flushMode)
Set the flush mode type to be used for the query execution. The flush mode type applies to the query regardless of the flush mode type in use for the entity manager.- Specified by:
setFlushModein interfacejavax.persistence.Query- Specified by:
setFlushModein interfacejavax.persistence.StoredProcedureQuery- Overrides:
setFlushModein classQueryImpl- Parameters:
flushMode- flush mode- Returns:
- the same query instance
-
setHint
public javax.persistence.StoredProcedureQuery setHint(java.lang.String hintName, java.lang.Object value)Set a query property or hint. The hints elements may be used to specify query properties and hints. Properties defined by this specification must be observed by the provider. Vendor-specific hints that are not recognized by a provider must be silently ignored. Portable applications should not rely on the standard timeout hint. Depending on the database in use, this hint may or may not be observed.- Specified by:
setHintin interfacejavax.persistence.Query- Specified by:
setHintin interfacejavax.persistence.StoredProcedureQuery- Parameters:
hintName- name of the property or hintvalue- value for the property or hint- Returns:
- the same query instance
- Throws:
java.lang.IllegalArgumentException- if the second argument is not valid for the implementation
-
setLockMode
public StoredProcedureQueryImpl setLockMode(javax.persistence.LockModeType lockMode)
Set the lock mode type to be used for the query execution.- Specified by:
setLockModein interfacejavax.persistence.Query- Overrides:
setLockModein classQueryImpl- Parameters:
lockMode-- Throws:
java.lang.IllegalStateException- if not a Java Persistence query language SELECT query
-
setMaxResults
public StoredProcedureQueryImpl setMaxResults(int maxResult)
Set the maximum number of results to retrieve.- Specified by:
setMaxResultsin interfacejavax.persistence.Query- Overrides:
setMaxResultsin classQueryImpl- Parameters:
maxResult-- Returns:
- the same query instance
-
setParameter
public javax.persistence.StoredProcedureQuery setParameter(int position, java.util.Calendar value, javax.persistence.TemporalType temporalType)Bind an instance of java.util.Calendar to a positional parameter.- Specified by:
setParameterin interfacejavax.persistence.Query- Specified by:
setParameterin interfacejavax.persistence.StoredProcedureQuery- Parameters:
position-value-temporalType-- Returns:
- the same query instance
- Throws:
java.lang.IllegalArgumentException- if position does not correspond to a positional parameter of the query or if the value argument is of incorrect type
-
setParameter
public javax.persistence.StoredProcedureQuery setParameter(int position, java.util.Date value, javax.persistence.TemporalType temporalType)Bind an instance of java.util.Date to a positional parameter.- Specified by:
setParameterin interfacejavax.persistence.Query- Specified by:
setParameterin interfacejavax.persistence.StoredProcedureQuery- Parameters:
position-value-temporalType-- Returns:
- the same query instance
- Throws:
java.lang.IllegalArgumentException- if position does not correspond to a positional parameter of the query or if the value argument is of incorrect type
-
setParameter
public javax.persistence.StoredProcedureQuery setParameter(int position, java.lang.Object value)Bind an argument to a positional parameter.- Specified by:
setParameterin interfacejavax.persistence.Query- Specified by:
setParameterin interfacejavax.persistence.StoredProcedureQuery- Parameters:
position-value-- Returns:
- the same query instance
- Throws:
java.lang.IllegalArgumentException- if position does not correspond to a positional parameter of the query or if the argument is of incorrect type
-
setParameter
public javax.persistence.StoredProcedureQuery setParameter(javax.persistence.Parameter<java.util.Calendar> param, java.util.Calendar value, javax.persistence.TemporalType temporalType)Bind an instance of java.util.Calendar to a Parameter object.- Specified by:
setParameterin interfacejavax.persistence.Query- Specified by:
setParameterin interfacejavax.persistence.StoredProcedureQuery- Parameters:
param-value-temporalType-- Returns:
- the same query instance
- Throws:
java.lang.IllegalArgumentException- if the parameter does not correspond to a parameter of the query
-
setParameter
public javax.persistence.StoredProcedureQuery setParameter(javax.persistence.Parameter<java.util.Date> param, java.util.Date value, javax.persistence.TemporalType temporalType)Bind an instance of java.util.Date to a Parameter object.- Specified by:
setParameterin interfacejavax.persistence.Query- Specified by:
setParameterin interfacejavax.persistence.StoredProcedureQuery- Parameters:
param-value-temporalType-- Returns:
- the same query instance
- Throws:
java.lang.IllegalArgumentException- if the parameter does not correspond to a parameter of the query
-
setParameter
public <T> javax.persistence.StoredProcedureQuery setParameter(javax.persistence.Parameter<T> param, T value)Bind the value of a Parameter object.- Specified by:
setParameterin interfacejavax.persistence.Query- Specified by:
setParameterin interfacejavax.persistence.StoredProcedureQuery- Parameters:
param-value-- Returns:
- the same query instance
- Throws:
java.lang.IllegalArgumentException- if the parameter does not correspond to a parameter of the query
-
setParameter
public javax.persistence.StoredProcedureQuery setParameter(java.lang.String name, java.util.Calendar value, javax.persistence.TemporalType temporalType)Bind an instance of java.util.Calendar to a named parameter.- Specified by:
setParameterin interfacejavax.persistence.Query- Specified by:
setParameterin interfacejavax.persistence.StoredProcedureQuery- Parameters:
name-value-temporalType-- Returns:
- the same query instance
- Throws:
java.lang.IllegalArgumentException- if the parameter name does not correspond to a parameter of the query or if the value argument is of incorrect type
-
setParameter
public javax.persistence.StoredProcedureQuery setParameter(java.lang.String name, java.util.Date value, javax.persistence.TemporalType temporalType)Bind an instance of java.util.Date to a named parameter.- Specified by:
setParameterin interfacejavax.persistence.Query- Specified by:
setParameterin interfacejavax.persistence.StoredProcedureQuery- Parameters:
name-value-temporalType-- Returns:
- the same query instance
- Throws:
java.lang.IllegalArgumentException- if the parameter name does not correspond to a parameter of the query or if the value argument is of incorrect type
-
setParameter
public javax.persistence.StoredProcedureQuery setParameter(java.lang.String name, java.lang.Object value)Bind an argument to a named parameter.- Specified by:
setParameterin interfacejavax.persistence.Query- Specified by:
setParameterin interfacejavax.persistence.StoredProcedureQuery- Parameters:
name-value-- Returns:
- the same query instance
- Throws:
java.lang.IllegalArgumentException- if the parameter name does not correspond to a parameter of the query or if the argument is of incorrect type
-
setParameterInternal
protected void setParameterInternal(java.lang.String name, java.lang.Object value, boolean isIndex)Bind an argument to a named or indexed parameter.- Overrides:
setParameterInternalin classQueryImpl- Parameters:
name- the parameter namevalue- to bindisIndex- defines if index or named
-
-