|
EclipseLink 2.0.0_ 2.0.0.v20090626-r4569 API Reference | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Query
Interface used to control query execution.
| Method Summary | ||
|---|---|---|
int |
executeUpdate()
Execute an update or delete statement. |
|
int |
getFirstResult()
The position of the first result the query object was set to retrieve. |
|
FlushModeType |
getFlushMode()
The flush mode in effect for the query execution. |
|
java.util.Map<java.lang.String,java.lang.Object> |
getHints()
Get the hints and associated values that are in effect for the query instance. |
|
LockModeType |
getLockMode()
Get the current lock mode for the query. |
|
int |
getMaxResults()
The maximum number of results the query object was set to retrieve. |
|
|
getParameter(int position,
java.lang.Class<T> type)
Get the positional parameter with the given position and type. |
|
|
getParameter(java.lang.String name,
java.lang.Class<T> type)
Get the parameter of the given name and type. |
|
java.util.Set<Parameter<?>> |
getParameters()
Get the query parameter objects. |
|
|
getParameterValue(Parameter<T> param)
Return the value that has been bound to the parameter. |
|
java.util.List |
getResultList()
Execute a SELECT query and return the query results as an untyped List. |
|
java.lang.Object |
getSingleResult()
Execute a SELECT query that returns a single untyped result. |
|
java.util.Set<java.lang.String> |
getSupportedHints()
Get the names of the hints that are supported for query objects. |
|
Query |
setFirstResult(int startPosition)
Set the position of the first result to retrieve. |
|
Query |
setFlushMode(FlushModeType flushMode)
Set the flush mode type to be used for the query execution. |
|
Query |
setHint(java.lang.String hintName,
java.lang.Object value)
Set a query hint. |
|
Query |
setLockMode(LockModeType lockMode)
Set the lock mode type to be used for the query execution. |
|
Query |
setMaxResults(int maxResult)
Set the maximum number of results to retrieve. |
|
Query |
setParameter(int position,
java.util.Calendar value,
TemporalType temporalType)
Bind an instance of java.util.Calendar to a positional parameter. |
|
Query |
setParameter(int position,
java.util.Date value,
TemporalType temporalType)
Bind an instance of java.util.Date to a positional parameter. |
|
Query |
setParameter(int position,
java.lang.Object value)
Bind an argument to a positional parameter. |
|
|
setParameter(Parameter<T> param,
T value)
Set the value of a Parameter object. |
|
Query |
setParameter(java.lang.String name,
java.util.Calendar value,
TemporalType temporalType)
Bind an instance of java.util.Calendar to a named parameter. |
|
Query |
setParameter(java.lang.String name,
java.util.Date value,
TemporalType temporalType)
Bind an instance of java.util.Date to a named parameter. |
|
Query |
setParameter(java.lang.String name,
java.lang.Object value)
Bind an argument to a named parameter. |
|
|
unwrap(java.lang.Class<T> cls)
Return an object of the specified type to allow access to the provider-specific API. |
|
| Method Detail |
|---|
java.util.List getResultList()
java.lang.IllegalStateException - if called for a Java Persistence query language UPDATE or
DELETE statement
QueryTimeoutException - if the query execution exceeds the query timeout value set
TransactionRequiredException - if a lock mode has been set and there is no transaction
PessimisticLockException - if pessimistic locking fails and the transaction is rolled
back
LockTimeoutException - if pessimistic locking fails and only the statement is rolled
backjava.lang.Object getSingleResult()
NoResultException - if there is no result
NonUniqueResultException - if more than one result
java.lang.IllegalStateException - if called for a Java Persistence query language UPDATE or
DELETE statement
QueryTimeoutException - if the query execution exceeds the query timeout value set
TransactionRequiredException - if a lock mode has been set and there is no transaction
PessimisticLockException - if pessimistic locking fails and the transaction is rolled
back
LockTimeoutException - if pessimistic locking fails and only the statement is rolled
backint executeUpdate()
java.lang.IllegalStateException - if called for a Java Persistence query language SELECT
statement or for a criteria query
TransactionRequiredException - if there is no transaction
QueryTimeoutException - if the statement execution exceeds the query timeout value
setQuery setMaxResults(int maxResult)
maxResult -
java.lang.IllegalArgumentException - if argument is negativeint getMaxResults()
Query setFirstResult(int startPosition)
start - position of the first result, numbered from 0
java.lang.IllegalArgumentException - if argument is negativeint getFirstResult()
Query setHint(java.lang.String hintName,
java.lang.Object value)
hintName - value -
java.lang.IllegalArgumentException - if the second argument is not valid for the implementationjava.util.Map<java.lang.String,java.lang.Object> getHints()
java.util.Set<java.lang.String> getSupportedHints()
Query setParameter(java.lang.String name,
java.lang.Object value)
name - the parameter namevalue -
java.lang.IllegalArgumentException - if parameter name does not correspond to a parameter of the
query or if the argument is of incorrect type
Query setParameter(java.lang.String name,
java.util.Date value,
TemporalType temporalType)
name - value - temporalType -
java.lang.IllegalArgumentException - if parameter name does not correspond to a parameter of the
query
Query setParameter(java.lang.String name,
java.util.Calendar value,
TemporalType temporalType)
name - value - temporalType -
java.lang.IllegalArgumentException - if parameter name does not correspond to a parameter of the
query
<T> Query setParameter(Parameter<T> param,
T value)
param - parameter to be setvalue - parameter value
java.lang.IllegalArgumentException - if parameter
does not correspond to a parameter of the
query
Query setParameter(int position,
java.lang.Object value)
position - value -
java.lang.IllegalArgumentException - if position does not correspond to a positional parameter of
the query or if the argument is of incorrect type
Query setParameter(int position,
java.util.Date value,
TemporalType temporalType)
position - value - temporalType -
java.lang.IllegalArgumentException - if position does not correspond to a positional parameter of
the query
Query setParameter(int position,
java.util.Calendar value,
TemporalType temporalType)
position - value - temporalType -
java.lang.IllegalArgumentException - if position does not correspond to a positional parameter of
the queryjava.util.Set<Parameter<?>> getParameters()
<T> Parameter<T> getParameter(java.lang.String name,
java.lang.Class<T> type)
java.lang.IllegalArgumentException - if the parameter of the specified name and type doesn't exist
<T> Parameter<T> getParameter(int position,
java.lang.Class<T> type)
java.lang.IllegalArgumentException - if the parameter with the specified position and type doesn't
exist<T> T getParameterValue(Parameter<T> param)
param - parameter object
java.lang.IllegalStateException - if the parameter has not been been boundQuery setFlushMode(FlushModeType flushMode)
flushMode - FlushModeType getFlushMode()
Query setLockMode(LockModeType lockMode)
lockMode -
java.lang.IllegalStateException - if the query is found not to be a Java Persistence query
language SELECT query or a Criteria API queryLockModeType getLockMode()
java.lang.IllegalStateException - if the query is found not to be a Java Persistence query
language SELECT query or a Criteria API query<T> T unwrap(java.lang.Class<T> cls)
cls - the class of the object to be returned. This is normally
either the underlying Query implementation class or an
interface that it implements.
PersistenceException - if the provider does not support the call.
|
EclipseLink 2.0.0_ 2.0.0.v20090626-r4569 API Reference | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||