|
EclipseLink 2.0.0_ 2.0.0.r3652-M1 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. |
|
java.util.Map<java.lang.String,java.lang.Object> |
getNamedParameters()
Get the parameters names and associated values of the parameters that are bound for the query instance. |
|
java.util.List |
getPositionalParameters()
Get the values of the positional parameters that are bound for the query instance. |
|
java.util.List |
getResultList()
Execute a SELECT query and return the query results as a List. |
|
java.lang.Object |
getSingleResult()
Execute a SELECT query that returns a single 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 an implementation-specific 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. |
|
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 statementjava.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 statementint executeUpdate()
java.lang.IllegalStateException - if called for a Java Persistence query language SELECT
statement
TransactionRequiredException - if there is no transactionQuery setMaxResults(int maxResult)
maxResult -
java.lang.IllegalArgumentException - if argument is negativeint getMaxResults()
Query setFirstResult(int startPosition)
startPosition - the 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 parameter in query
string or 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 parameter in query
string
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 parameter in query
string
Query setParameter(int position,
java.lang.Object value)
position - value -
java.lang.IllegalArgumentException - if position does not correspond to positional parameter of
query or 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 positional parameter of
query
Query setParameter(int position,
java.util.Calendar value,
TemporalType temporalType)
position - value - temporalType -
java.lang.IllegalArgumentException - if position does not correspond to positional parameter of
queryjava.util.Map<java.lang.String,java.lang.Object> getNamedParameters()
java.util.List getPositionalParameters()
Query setFlushMode(FlushModeType flushMode)
flushMode - FlushModeType getFlushMode()
Query setLockMode(LockModeType lockMode)
lockMode -
java.lang.IllegalStateException - if not a Java Persistence query language SELECT queryLockModeType getLockMode()
java.lang.IllegalStateException - if not a Java Persistence query language SELECT 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.r3652-M1 API Reference | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||