|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
X - query result typepublic interface TypedQuery<X>
Interface used to control the execution of typed queries.
| Method Summary | ||
|---|---|---|
List<X> |
getResultList()
Execute a SELECT query and return the query results as a typed List. |
|
X |
getSingleResult()
Execute a SELECT query that returns a single result. |
|
TypedQuery<X> |
setFirstResult(int startPosition)
Set the position of the first result to retrieve. |
|
TypedQuery<X> |
setFlushMode(FlushModeType flushMode)
Set the flush mode type to be used for the query execution. |
|
TypedQuery<X> |
setHint(String hintName,
Object value)
Set a query property or hint. |
|
TypedQuery<X> |
setLockMode(LockModeType lockMode)
Set the lock mode type to be used for the query execution. |
|
TypedQuery<X> |
setMaxResults(int maxResult)
Set the maximum number of results to retrieve. |
|
TypedQuery<X> |
setParameter(int position,
Calendar value,
TemporalType temporalType)
Bind an instance of java.util.Calendar to a positional parameter. |
|
TypedQuery<X> |
setParameter(int position,
Date value,
TemporalType temporalType)
Bind an instance of java.util.Date to a positional parameter. |
|
TypedQuery<X> |
setParameter(int position,
Object value)
Bind an argument to a positional parameter. |
|
TypedQuery<X> |
setParameter(Parameter<Calendar> param,
Calendar value,
TemporalType temporalType)
Bind an instance of java.util.Calendar to a Parameter object. |
|
TypedQuery<X> |
setParameter(Parameter<Date> param,
Date value,
TemporalType temporalType)
Bind an instance of java.util.Date to a Parameter object. |
|
|
setParameter(Parameter<T> param,
T value)
Bind the value of a Parameter object. |
|
TypedQuery<X> |
setParameter(String name,
Calendar value,
TemporalType temporalType)
Bind an instance of java.util.Calendar to a named parameter. |
|
TypedQuery<X> |
setParameter(String name,
Date value,
TemporalType temporalType)
Bind an instance of java.util.Date to a named parameter. |
|
TypedQuery<X> |
setParameter(String name,
Object value)
Bind an argument to a named parameter. |
|
| Methods inherited from interface javax.persistence.Query |
|---|
executeUpdate, getFirstResult, getFlushMode, getHints, getLockMode, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, isBound, unwrap |
| Method Detail |
|---|
List<X> getResultList()
getResultList in interface QueryIllegalStateException - if called for a Java Persistence query language UPDATE or DELETE statement
QueryTimeoutException - if the query execution exceeds the query timeout value set and only the statement is rolled
back
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 back
PersistenceException - if the query execution exceeds the query timeout value set and the transaction is rolled backX getSingleResult()
getSingleResult in interface QueryNoResultException - if there is no result
NonUniqueResultException - if more than one result
IllegalStateException - if called for a Java Persistence query language UPDATE or DELETE statement
QueryTimeoutException - if the query execution exceeds the query timeout value set and only the statement is rolled
back
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 back
PersistenceException - if the query execution exceeds the query timeout value set and the transaction is rolled backTypedQuery<X> setMaxResults(int maxResult)
setMaxResults in interface QuerymaxResult -
IllegalArgumentException - if the argument is negativeTypedQuery<X> setFirstResult(int startPosition)
setFirstResult in interface QuerystartPosition - position of the first result, numbered from 0
IllegalArgumentException - if the argument is negative
TypedQuery<X> setHint(String hintName,
Object value)
setHint in interface QueryhintName - name of property or hintvalue -
IllegalArgumentException - if the second argument is not valid for the implementation
<T> TypedQuery<X> setParameter(Parameter<T> param,
T value)
setParameter in interface Queryparam - parameter objectvalue - parameter value
IllegalArgumentException - if the parameter does not correspond to a parameter of the query
TypedQuery<X> setParameter(Parameter<Calendar> param,
Calendar value,
TemporalType temporalType)
setParameter in interface Queryparam - parameter objectvalue - parameter valuetemporalType -
IllegalArgumentException - if the parameter does not correspond to a parameter of the query
TypedQuery<X> setParameter(Parameter<Date> param,
Date value,
TemporalType temporalType)
setParameter in interface Queryparam - parameter objectvalue - parameter valuetemporalType -
IllegalArgumentException - if the parameter does not correspond to a parameter of the query
TypedQuery<X> setParameter(String name,
Object value)
setParameter in interface Queryname - parameter namevalue - parameter value
IllegalArgumentException - if the parameter name does not correspond to a parameter of the query or if the argument
is of incorrect type
TypedQuery<X> setParameter(String name,
Calendar value,
TemporalType temporalType)
setParameter in interface Queryname - parameter namevalue - parameter valuetemporalType -
IllegalArgumentException - if the parameter name does not correspond to a parameter of the query or if the value
argument is of incorrect type
TypedQuery<X> setParameter(String name,
Date value,
TemporalType temporalType)
setParameter in interface Queryname - parameter namevalue - parameter valuetemporalType -
IllegalArgumentException - if the parameter name does not correspond to a parameter of the query or if the value
argument is of incorrect type
TypedQuery<X> setParameter(int position,
Object value)
setParameter in interface Queryposition - value - parameter value
IllegalArgumentException - if position does not correspond to a positional parameter of the query or if the argument
is of incorrect type
TypedQuery<X> setParameter(int position,
Calendar value,
TemporalType temporalType)
setParameter in interface Queryposition - value - parameter valuetemporalType -
IllegalArgumentException - if position does not correspond to a positional parameter of the query or if the value
argument is of incorrect type
TypedQuery<X> setParameter(int position,
Date value,
TemporalType temporalType)
setParameter in interface Queryposition - value - parameter valuetemporalType -
IllegalArgumentException - if position does not correspond to a positional parameter of the query or if the value
argument is of incorrect typeTypedQuery<X> setFlushMode(FlushModeType flushMode)
setFlushMode in interface QueryflushMode -
TypedQuery<X> setLockMode(LockModeType lockMode)
setLockMode in interface QuerylockMode -
IllegalStateException - if the query is found not to be a Java Persistence query language SELECT query or a Criteria
API query
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||