org.shiftone.exq
Interface Query

All Known Implementing Classes:
QueryImpl

public interface Query

Implementations of this interface are NOT expected to be thread safe, as they must hold call specific parameters.

Author:
Jeff Drost

Method Summary
 void clearParameters()
          Resets the values of all parameters to null.
 Cursor execute()
          Execute the query, causing it to fetch data based on the current values for the parameters.
 Cursor execute(int pageNumber, int rowsPerPage)
          Execute the query, causing it to fetch data based on the current values for the parameters.
 void setParameter(java.lang.String name, boolean value)
          Sets the designated parameter value to the given boolean.
 void setParameter(java.lang.String name, char value)
          Sets the designated parameter value to the given char.
 void setParameter(java.lang.String name, java.util.Date value)
          Sets the designated parameter value to the given Date.
 void setParameter(java.lang.String name, double value)
          Sets the designated parameter value to the given double.
 void setParameter(java.lang.String name, float value)
          Sets the designated parameter value to the given float.
 void setParameter(java.lang.String name, int value)
          Sets the designated parameter value to the given int.
 void setParameter(java.lang.String name, long value)
          Sets the designated parameter value to the given long.
 void setParameter(java.lang.String name, java.lang.Object value)
          Sets the designated parameter value to the given Object.
 void setParameter(java.lang.String name, java.lang.String value)
          Sets the designated parameter value to the given String.
 

Method Detail

setParameter

public void setParameter(java.lang.String name,
                         java.util.Date value)
Sets the designated parameter value to the given Date.


setParameter

public void setParameter(java.lang.String name,
                         boolean value)
Sets the designated parameter value to the given boolean.


setParameter

public void setParameter(java.lang.String name,
                         char value)
Sets the designated parameter value to the given char.


setParameter

public void setParameter(java.lang.String name,
                         double value)
Sets the designated parameter value to the given double.


setParameter

public void setParameter(java.lang.String name,
                         float value)
Sets the designated parameter value to the given float.


setParameter

public void setParameter(java.lang.String name,
                         int value)
Sets the designated parameter value to the given int.


setParameter

public void setParameter(java.lang.String name,
                         long value)
Sets the designated parameter value to the given long.


setParameter

public void setParameter(java.lang.String name,
                         java.lang.String value)
Sets the designated parameter value to the given String.


setParameter

public void setParameter(java.lang.String name,
                         java.lang.Object value)
Sets the designated parameter value to the given Object.


clearParameters

public void clearParameters()
Resets the values of all parameters to null. This is the state that the Query was created with.


execute

public Cursor execute()
               throws QException
Execute the query, causing it to fetch data based on the current values for the parameters.

Throws:
QException

execute

public Cursor execute(int pageNumber,
                      int rowsPerPage)
               throws QException
Execute the query, causing it to fetch data based on the current values for the parameters. The Cursor created from this method will be a window into the actual results that were fetched.

Page number is zero based. The Cursor that is returned will also know which page it is, and how many total pages there are.

When using this option for pagination, it is recomended that caching features be taken advantage of as not to waste the effort of querying the data source for only one page of content.

Throws:
QException