Interface Query

All Known Subinterfaces:
OQLQuery
All Known Implementing Classes:
OQLQueryImpl

public interface Query
A query object. Obtained from the database and used to construct and execute a query on that database. All query operations are bound to the database transaction. Closing the database or the transaction will effectively close the query.

If the query specified parameters these parameters must be set (bound) before executing the query. Execution of the query will result in an enumeration of all the objects found by the query. The query can be re-executed by binding new parameters and calling the execute() method a second time. A query can be re-execute while objects are still retrieved from a previous execution.

Version:
$Revision: 7121 $ $Date: 2006-03-16 16:04:24 -0700 (Thu, 16 Mar 2006) $
Author:
Assaf Arkin
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    bind(boolean value)
    Bind a parameter value to the query.
    void
    bind(double value)
    Bind a parameter value to the query.
    void
    bind(float value)
    Bind a parameter value to the query.
    void
    bind(int value)
    Bind a parameter value to the query.
    void
    bind(long value)
    Bind a parameter value to the query.
    void
    bind(short value)
    Bind a parameter value to the query.
    void
    bind(Object value)
    Bind a parameter value to the query.
    void
    Close the query and release all resources held by the query.
    Execute the query.
    execute(boolean scrollable)
    This is used for cursor support.
    execute(AccessMode accessMode)
    Execute the query.
    execute(AccessMode accessMode, boolean scrollable)
    This is used for cursor support.
  • Method Details

    • bind

      void bind(Object value) throws IllegalArgumentException
      Bind a parameter value to the query. Parameters are set in the order in which they appear in the query and must match in number and type of each parameter.
      Parameters:
      value - The parameter value
      Throws:
      IllegalArgumentException - The parameter is not of the expected type, or more parameters were supplied that the query specified
    • bind

      void bind(boolean value) throws IllegalArgumentException
      Bind a parameter value to the query. Parameters are set in the order in which they appear in the query and must match in number and type of each parameter.
      Parameters:
      value - The parameter value
      Throws:
      IllegalArgumentException - The parameter is not of the expected type, or more parameters were supplied that the query specified
    • bind

      void bind(short value) throws IllegalArgumentException
      Bind a parameter value to the query. Parameters are set in the order in which they appear in the query and must match in number and type of each parameter.
      Parameters:
      value - The parameter value
      Throws:
      IllegalArgumentException - The parameter is not of the expected type, or more parameters were supplied that the query specified
    • bind

      void bind(int value) throws IllegalArgumentException
      Bind a parameter value to the query. Parameters are set in the order in which they appear in the query and must match in number and type of each parameter.
      Parameters:
      value - The parameter value
      Throws:
      IllegalArgumentException - The parameter is not of the expected type, or more parameters were supplied that the query specified
    • bind

      void bind(long value) throws IllegalArgumentException
      Bind a parameter value to the query. Parameters are set in the order in which they appear in the query and must match in number and type of each parameter.
      Parameters:
      value - The parameter value
      Throws:
      IllegalArgumentException - The parameter is not of the expected type, or more parameters were supplied that the query specified
    • bind

      void bind(float value) throws IllegalArgumentException
      Bind a parameter value to the query. Parameters are set in the order in which they appear in the query and must match in number and type of each parameter.
      Parameters:
      value - The parameter value
      Throws:
      IllegalArgumentException - The parameter is not of the expected type, or more parameters were supplied that the query specified
    • bind

      void bind(double value) throws IllegalArgumentException
      Bind a parameter value to the query. Parameters are set in the order in which they appear in the query and must match in number and type of each parameter.
      Parameters:
      value - The parameter value
      Throws:
      IllegalArgumentException - The parameter is not of the expected type, or more parameters were supplied that the query specified
    • execute

      Execute the query. The query is executed returning an enumeration of all the objects found. If no objects were found, the enumeration will be empty.

      After execution the parameter list is reset. New parameters can be bound and the query re-executed.

      Returns:
      Query results (zero or more objects)
      Throws:
      QueryException - The query expression cannot be processed, or the query parameters are invalid
      TransactionNotInProgressException - Method called while transaction is not in progress
      PersistenceException - An error reported by the persistence engine
    • execute

      QueryResults execute(boolean scrollable) throws PersistenceException
      This is used for cursor support. Experimental
      Throws:
      PersistenceException
    • execute

      QueryResults execute(AccessMode accessMode) throws PersistenceException
      Execute the query. The query is executed returning an enumeration of all the objects found. If no objects were found, the enumeration will be empty.

      After execution the parameter list is reset. New parameters can be bound and the query re-executed.

      Parameters:
      accessMode - The access mode
      Returns:
      Query results (zero or more objects)
      Throws:
      QueryException - The query expression cannot be processed, or the query parameters are invalid
      TransactionNotInProgressException - Method called while transaction is not in progress
      PersistenceException - An error reported by the persistence engine
    • execute

      QueryResults execute(AccessMode accessMode, boolean scrollable) throws PersistenceException
      This is used for cursor support. Experimental
      Throws:
      PersistenceException
    • close

      void close()
      Close the query and release all resources held by the query.