com.caucho.amber
Interface AmberQuery

All Known Implementing Classes:
UserQuery

public interface AmberQuery

Represents an Amber query


Method Summary
 java.sql.ResultSet executeQuery()
          Executes the query returning a result set.
 int executeUpdate()
          Executes the query as an update, returning the rows changed.
 java.lang.String getQueryString()
          Returns the query string.
 java.lang.Object getSingleResult()
          Execute the query, returning a single value
 void init(AmberConnection aConn)
          Initialize with the connection.
 java.util.List<java.lang.Object> list()
          Execute the query, returning a list.
 void list(java.util.List<java.lang.Object> list)
          Execute the query, filling a list.
 void list(java.util.Map<java.lang.Object,java.lang.Object> map, java.lang.reflect.Method methodGetMapKey)
          Execute the query, filling a map.
 void setByte(int index, byte v)
          Sets the argument with a byte
 void setCacheMaxAge(long ms)
          Sets the cache max age.
 void setDate(int index, java.sql.Date v)
          Sets the argument with a date
 void setDouble(int index, double v)
          Sets the argument with a double
 void setFirstResult(int index)
          Sets the first result.
 void setFloat(int index, float v)
          Sets the argument with a double
 void setInt(int index, int v)
          Sets the argument with an integer
 void setLoadOnQuery(boolean isLoad)
          Sets the load on query.
 void setLong(int index, long v)
          Sets the argument with a long
 void setMaxResults(int index)
          Sets the maximum number of results.
 void setNull(int index, int type)
          Sets the argument with an null.
 void setObject(int index, java.lang.Object v)
          Sets the argument with an object.
 void setShort(int index, short v)
          Sets the argument with a short
 void setString(int index, java.lang.String v)
          Sets the argument with a string
 void setTimestamp(int index, java.sql.Timestamp v)
          Sets the argument with a timestamp
 

Method Detail

init

void init(AmberConnection aConn)
Initialize with the connection.


getQueryString

java.lang.String getQueryString()
Returns the query string.


setString

void setString(int index,
               java.lang.String v)
Sets the argument with a string


setByte

void setByte(int index,
             byte v)
Sets the argument with a byte


setShort

void setShort(int index,
              short v)
Sets the argument with a short


setInt

void setInt(int index,
            int v)
Sets the argument with an integer


setLong

void setLong(int index,
             long v)
Sets the argument with a long


setDouble

void setDouble(int index,
               double v)
Sets the argument with a double


setFloat

void setFloat(int index,
              float v)
Sets the argument with a double


setTimestamp

void setTimestamp(int index,
                  java.sql.Timestamp v)
Sets the argument with a timestamp


setDate

void setDate(int index,
             java.sql.Date v)
Sets the argument with a date


setObject

void setObject(int index,
               java.lang.Object v)
Sets the argument with an object.


setNull

void setNull(int index,
             int type)
Sets the argument with an null.


setFirstResult

void setFirstResult(int index)
Sets the first result.


setMaxResults

void setMaxResults(int index)
Sets the maximum number of results.


executeQuery

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

Throws:
java.sql.SQLException

executeUpdate

int executeUpdate()
                  throws java.sql.SQLException
Executes the query as an update, returning the rows changed.

Throws:
java.sql.SQLException

setCacheMaxAge

void setCacheMaxAge(long ms)
Sets the cache max age.


getSingleResult

java.lang.Object getSingleResult()
                                 throws java.sql.SQLException
Execute the query, returning a single value

Throws:
java.sql.SQLException

list

java.util.List<java.lang.Object> list()
                                      throws java.sql.SQLException
Execute the query, returning a list.

Throws:
java.sql.SQLException

list

void list(java.util.List<java.lang.Object> list)
          throws java.sql.SQLException
Execute the query, filling a list.

Throws:
java.sql.SQLException

list

void list(java.util.Map<java.lang.Object,java.lang.Object> map,
          java.lang.reflect.Method methodGetMapKey)
          throws java.sql.SQLException,
                 java.lang.IllegalAccessException,
                 java.lang.reflect.InvocationTargetException
Execute the query, filling a map.

Throws:
java.sql.SQLException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

setLoadOnQuery

void setLoadOnQuery(boolean isLoad)
Sets the load on query.