|
||||||||||
| 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. |
List |
getResultList()
Execute the query and return the query results as a List. |
Object |
getSingleResult()
Execute a query that returns a single result. |
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(String hintName,
Object value)
Set an implementation-specific hint. |
Query |
setMaxResults(int maxResult)
Set the maximum number of results to retrieve. |
Query |
setParameter(int position,
Calendar value,
TemporalType temporalType)
Bind an instance of java.util.Calendar to a positional parameter. |
Query |
setParameter(int position,
Date value,
TemporalType temporalType)
Bind an instance of java.util.Date to a positional parameter. |
Query |
setParameter(int position,
Object value)
Bind an argument to a positional parameter. |
Query |
setParameter(String name,
Calendar value,
TemporalType temporalType)
Bind an instance of java.util.Calendar to a named parameter. |
Query |
setParameter(String name,
Date value,
TemporalType temporalType)
Bind an instance of java.util.Date to a named parameter. |
Query |
setParameter(String name,
Object value)
Bind an argument to a named parameter. |
| Method Detail |
|---|
List getResultList()
IllegalStateException - f called for a Java Persistence query language UPDATE or DELETE statementObject getSingleResult()
EntityNotFoundException - if there is no result
NonUniqueResultException - if more than one resul
IllegalStateException - f called for a Java Persistence query language UPDATE or DELETE statementint executeUpdate()
IllegalStateException - if called for a Java Persistence query language SELECT statement
TransactionRequiredException - if there is no transactionQuery setMaxResults(int maxResult)
maxResult -
IllegalArgumentException - if argument is negativeQuery setFirstResult(int startPosition)
startPosition - position of the first result, numbered from 0
IllegalArgumentException - if argument is negative
Query setHint(String hintName,
Object value)
hintName - value -
IllegalArgumentException - if the second argument is not valid for the implementation
Query setParameter(String name,
Object value)
name - the parameter namevalue -
IllegalArgumentException - if parameter name does not correspond to parameter in query
string or argument is of incorrect type
Query setParameter(String name,
Date value,
TemporalType temporalType)
name - value - temporalType -
IllegalArgumentException - if parameter name does not correspond to parameter in query
string
Query setParameter(String name,
Calendar value,
TemporalType temporalType)
name - value - temporalType -
IllegalArgumentException - if parameter name does not correspond to parameter in query
string
Query setParameter(int position,
Object value)
position - value -
IllegalArgumentException - if position does not correspond to positional parameter of
query or argument is of incorrect type
Query setParameter(int position,
Date value,
TemporalType temporalType)
position - value - temporalType -
IllegalArgumentException - if position does not correspond to positional parameter of
query
Query setParameter(int position,
Calendar value,
TemporalType temporalType)
position - value - temporalType -
Query setFlushMode(FlushModeType flushMode)
flushMode -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||