javax.persistence
Interface TypedQuery<X>

All Superinterfaces:
Query

public interface TypedQuery<X>
extends Query

Represents a typed SQL query.


Method Summary
 java.util.List<X> getResultList()
          Executes a SELECT and return the results as a list.
 X getSingleResult()
          Returns the single result of a query.
 TypedQuery<X> setFirstResult(int startPosition)
          Sets the first result.
 TypedQuery<X> setFlushMode(FlushModeType flushMode)
          Sets the flush type.
 TypedQuery<X> setHint(java.lang.String hintName, java.lang.Object value)
          An implementation-specific hint.
 TypedQuery<X> setLockMode(LockModeType lockMode)
          Sets the lock type.
 TypedQuery<X> setMaxResults(int maxResult)
          The maximum number of results to retrieve.
 TypedQuery<X> setParameter(int position, java.util.Calendar value, TemporalType temporalType)
          Sets a calendar parameter.
 TypedQuery<X> setParameter(int position, java.util.Date value, TemporalType temporalType)
          Sets a date parameter.
 TypedQuery<X> setParameter(int position, java.lang.Object value)
          Binds a position parameter.
 TypedQuery<X> setParameter(Parameter<java.util.Calendar> param, java.util.Calendar value, TemporalType temporalType)
          Sets a calendar parameter.
 TypedQuery<X> setParameter(Parameter<java.util.Date> param, java.util.Date value, TemporalType temporalType)
          Sets a date parameter.
<T> TypedQuery<X>
setParameter(Parameter<T> parameter, T value)
          Binds a named parameter.
 TypedQuery<X> setParameter(java.lang.String name, java.util.Calendar value, TemporalType temporalType)
          Sets a calendar parameter.
 TypedQuery<X> setParameter(java.lang.String name, java.util.Date value, TemporalType temporalType)
          Sets a date parameter.
 TypedQuery<X> setParameter(java.lang.String name, java.lang.Object value)
          Binds a position 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

getSingleResult

X getSingleResult()
Description copied from interface: Query
Returns the single result of a query.

Specified by:
getSingleResult in interface Query

getResultList

java.util.List<X> getResultList()
Description copied from interface: Query
Executes a SELECT and return the results as a list.

Specified by:
getResultList in interface Query

setMaxResults

TypedQuery<X> setMaxResults(int maxResult)
Description copied from interface: Query
The maximum number of results to retrieve.

Specified by:
setMaxResults in interface Query

setFirstResult

TypedQuery<X> setFirstResult(int startPosition)
Description copied from interface: Query
Sets the first result.

Specified by:
setFirstResult in interface Query

setHint

TypedQuery<X> setHint(java.lang.String hintName,
                      java.lang.Object value)
Description copied from interface: Query
An implementation-specific hint.

Specified by:
setHint in interface Query

setParameter

<T> TypedQuery<X> setParameter(Parameter<T> parameter,
                               T value)
Description copied from interface: Query
Binds a named parameter.

Specified by:
setParameter in interface Query

setParameter

TypedQuery<X> setParameter(Parameter<java.util.Calendar> param,
                           java.util.Calendar value,
                           TemporalType temporalType)
Description copied from interface: Query
Sets a calendar parameter.

Specified by:
setParameter in interface Query

setParameter

TypedQuery<X> setParameter(Parameter<java.util.Date> param,
                           java.util.Date value,
                           TemporalType temporalType)
Description copied from interface: Query
Sets a date parameter.

Specified by:
setParameter in interface Query

setParameter

TypedQuery<X> setParameter(java.lang.String name,
                           java.lang.Object value)
Description copied from interface: Query
Binds a position parameter.

Specified by:
setParameter in interface Query

setParameter

TypedQuery<X> setParameter(java.lang.String name,
                           java.util.Calendar value,
                           TemporalType temporalType)
Description copied from interface: Query
Sets a calendar parameter.

Specified by:
setParameter in interface Query

setParameter

TypedQuery<X> setParameter(java.lang.String name,
                           java.util.Date value,
                           TemporalType temporalType)
Description copied from interface: Query
Sets a date parameter.

Specified by:
setParameter in interface Query

setParameter

TypedQuery<X> setParameter(int position,
                           java.lang.Object value)
Description copied from interface: Query
Binds a position parameter.

Specified by:
setParameter in interface Query

setParameter

TypedQuery<X> setParameter(int position,
                           java.util.Calendar value,
                           TemporalType temporalType)
Description copied from interface: Query
Sets a calendar parameter.

Specified by:
setParameter in interface Query

setParameter

TypedQuery<X> setParameter(int position,
                           java.util.Date value,
                           TemporalType temporalType)
Description copied from interface: Query
Sets a date parameter.

Specified by:
setParameter in interface Query

setFlushMode

TypedQuery<X> setFlushMode(FlushModeType flushMode)
Description copied from interface: Query
Sets the flush type.

Specified by:
setFlushMode in interface Query

setLockMode

TypedQuery<X> setLockMode(LockModeType lockMode)
Description copied from interface: Query
Sets the lock type.

Specified by:
setLockMode in interface Query