Overview | Package | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.stc.eindex.ejb.query
Interface QueryManager

public interface QueryManager

The QueryManager class executes the SQL queries against the master index database, providing a single point of access to database queries. The Query Manager reads an instance of the QueryObject class in order to execute the SQL query. It then calls the AssemblerEngine class, which uses the value object assembler specified in QueryObject to construct a Query Manager iterator (class QMIterator). The iterator is used to iterate through a collection of composite value objects. The composite value objects are used by other eView components, such as the match engine and the Enterprise Data Manager.

The Query Manager operates in two modes, execution mode and assembling mode. In execution mode, the Query Manager parses and executes the SQL statements, using information from the query object. In assembling mode, the Query Manager assembles the JDBC result set into the set of objects that can be used by the client. The resulting composite objects can be of any user-defined structure.

Method Summary
`QueryResults` | `execute(QueryObject qobject)` Executes the query or queries specified in the QueryObject class, but does not assemble the returned objects into an iterator.
`QMIterator` | `executeAssemble(QueryObject qobject)` Executes the query or queries specified in the QueryObject class, and uses the assembler engine to create an iterator of the objects returned by the queries.
`void` | `prepare(QueryObject qobject)` Prepares and caches the query object (class QueryObject) without executing the queries.

Method Detail

### execute

    public QueryResults execute(QueryObject qobject)
                         throws QMException

  Executes the query or queries specified in the QueryObject class, but does not assemble the returned objects into an iterator. The assembling information can later be specified to the returned QueryResults object using the AssembleDescriptor class.

  Parameters:
    `qobject` - The query object containing the criteria and conditions of the queries to execute.
  Returns:
    `QueryResults` - The objects that were returned as a result of the queries.
  Throws:
    `QMException` - Thrown if an error occurs while executing the query.

### executeAssemble

    public QMIterator executeAssemble(QueryObject qobject)
                               throws QMException

  Executes the query or queries specified in the QueryObject class, and uses the assembler engine to create an iterator of the objects returned by the queries.

  Parameters:
    `qobject` - The query object containing the criteria and conditions of the queries to execute.
  Returns:
    `QMIterator` - An iterator that can be used to retrieve each object returned from the queries.
  Throws:
    `QMException` - Thrown if an error occurs while executing the query or assembling the results.

### prepare

    public void prepare(QueryObject qobject)
                 throws QMException

  Prepares and caches the query object (class QueryObject) without executing the queries. The prepared query is set in PreparedConnectionPool. If you prepare and cache a query object (meaning the PreparedId is set) and then call the execute method, the query object is prepared before execution (if it is not already in pool). This method is optional.

  Parameters:
    `qobject` - The query object containing the criteria and conditions of the queries to execute.
  Returns:
    `void` - None.
  Throws:
    `QMException` - Thrown if an error occurs while preparing the query object.

Overview | Package | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2007 by Sun Microsystems, Inc. All Rights Reserved.