com.caucho.amber.ejb3
Class QueryImpl

java.lang.Object
  extended by com.caucho.amber.ejb3.QueryImpl
All Implemented Interfaces:
Query

public class QueryImpl
extends java.lang.Object
implements Query

The EJB query


Method Summary
protected  java.sql.ResultSet executeQuery()
          Executes the query returning a result set.
 int executeUpdate()
          Execute an update or delete.
 int getFirstResult()
          The first to retrieve.
 FlushModeType getFlushMode()
          Gets the flush type.
 java.util.Map getHints()
          Returns the implementation-specific hints
 LockModeType getLockMode()
          Gets the lock type.
 int getMaxResults()
          The maximum number of results to retrieve.
 java.util.Map getNamedParameters()
          Returns the named parameters as a map
 java.util.List getPositionalParameters()
          Returns the positional parameters as a list
 java.util.List getResultList()
          Execute the query and return as a List.
 java.lang.Object getSingleResult()
          Returns a single result.
 java.util.Set<java.lang.String> getSupportedHints()
          Returns the supported hints
 Query setDouble(int index, double value)
          Sets an indexed parameter.
 Query setFirstResult(int startPosition)
          Sets the position of the first result.
 Query setFlushMode(FlushModeType mode)
          Sets the flush mode type.
 Query setHint(java.lang.String hintName, java.lang.Object value)
          Sets a hint.
 Query setLockMode(LockModeType lockMode)
          Sets the lock type.
 Query setMaxResults(int maxResult)
          Sets the maximum result returned.
 Query setParameter(int index, java.util.Calendar value, TemporalType type)
          Sets a calendar parameter.
 Query setParameter(int index, java.util.Date value, TemporalType type)
          Sets a date parameter.
 Query setParameter(int index, java.lang.Object value)
          Sets an indexed parameter.
 Query setParameter(java.lang.String name, java.util.Calendar value, TemporalType type)
          Sets a calendar parameter.
 Query setParameter(java.lang.String name, java.util.Date value, TemporalType type)
          Sets a date parameter.
 Query setParameter(java.lang.String name, java.lang.Object value)
          Sets a named parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getResultList

public java.util.List getResultList()
Execute the query and return as a List.

Specified by:
getResultList in interface Query

getSingleResult

public java.lang.Object getSingleResult()
Returns a single result.

Specified by:
getSingleResult in interface Query

executeUpdate

public int executeUpdate()
Execute an update or delete.

Specified by:
executeUpdate in interface Query

executeQuery

protected java.sql.ResultSet executeQuery()
                                   throws java.sql.SQLException
Executes the query returning a result set.

Throws:
java.sql.SQLException

setMaxResults

public Query setMaxResults(int maxResult)
Sets the maximum result returned.

Specified by:
setMaxResults in interface Query

setFirstResult

public Query setFirstResult(int startPosition)
Sets the position of the first result.

Specified by:
setFirstResult in interface Query

setHint

public Query setHint(java.lang.String hintName,
                     java.lang.Object value)
Sets a hint.

Specified by:
setHint in interface Query

setParameter

public Query setParameter(java.lang.String name,
                          java.lang.Object value)
Sets a named parameter.

Specified by:
setParameter in interface Query

setParameter

public Query setParameter(java.lang.String name,
                          java.util.Date value,
                          TemporalType type)
Sets a date parameter.

Specified by:
setParameter in interface Query

setParameter

public Query setParameter(java.lang.String name,
                          java.util.Calendar value,
                          TemporalType type)
Sets a calendar parameter.

Specified by:
setParameter in interface Query

setParameter

public Query setParameter(int index,
                          java.lang.Object value)
Sets an indexed parameter.

Specified by:
setParameter in interface Query

setParameter

public Query setParameter(int index,
                          java.util.Date value,
                          TemporalType type)
Sets a date parameter.

Specified by:
setParameter in interface Query

setParameter

public Query setParameter(int index,
                          java.util.Calendar value,
                          TemporalType type)
Sets a calendar parameter.

Specified by:
setParameter in interface Query

setFlushMode

public Query setFlushMode(FlushModeType mode)
Sets the flush mode type.

Specified by:
setFlushMode in interface Query

setDouble

public Query setDouble(int index,
                       double value)
Sets an indexed parameter.


getMaxResults

public int getMaxResults()
The maximum number of results to retrieve.

Specified by:
getMaxResults in interface Query

getFirstResult

public int getFirstResult()
The first to retrieve.

Specified by:
getFirstResult in interface Query

getHints

public java.util.Map getHints()
Returns the implementation-specific hints

Specified by:
getHints in interface Query

getSupportedHints

public java.util.Set<java.lang.String> getSupportedHints()
Returns the supported hints

Specified by:
getSupportedHints in interface Query

getNamedParameters

public java.util.Map getNamedParameters()
Returns the named parameters as a map

Specified by:
getNamedParameters in interface Query
Since:
JPA 2.0

getPositionalParameters

public java.util.List getPositionalParameters()
Returns the positional parameters as a list

Specified by:
getPositionalParameters in interface Query
Since:
JPA 2.0

getFlushMode

public FlushModeType getFlushMode()
Gets the flush type.

Specified by:
getFlushMode in interface Query
Since:
JPA 2.0

setLockMode

public Query setLockMode(LockModeType lockMode)
Sets the lock type.

Specified by:
setLockMode in interface Query
Since:
JPA 2.0

getLockMode

public LockModeType getLockMode()
Gets the lock type.

Specified by:
getLockMode in interface Query
Since:
JPA 2.0