Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| deegree 2.4 (2010/11/11 10:47 build-27-official)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.deegree.io.datastore.sql
Class QueryHandler

    java.lang.Object
      org.deegree.io.datastore.sql.AbstractRequestHandler
          org.deegree.io.datastore.sql.FeatureFetcher
              org.deegree.io.datastore.sql.QueryHandler

    public class QueryHandler

extends FeatureFetcher

Handles `Query` requests to SQL backed datastores.

Version:
  $Revision: 20808 $, $Date: 2009-11-16 14:03:13 +0100 (Mo, 16. Nov 2009) $
Author:
  Markus Schneider , last edited by: $Author: mschneider $
See Also:
  `FeatureFetcher`, `AbstractSQLDatastore`, `QueryTableTree`

Field Summary

Fields inherited from class org.deegree.io.datastore.sql.FeatureFetcher
`featureMap, featuresInGeneration, fidToPropertyMap, vcProvider`

Fields inherited from class org.deegree.io.datastore.sql.AbstractRequestHandler
`aliasGenerator, conn, datastore, FT_COLUMN, FT_PREFIX`

Constructor Summary
`QueryHandler(AbstractSQLDatastore ds, TableAliasGenerator aliasGenerator, Connection conn, MappedFeatureType[] rootFts, Query query)` Creates a new instance of `QueryHandler` from the given parameters.

Method Summary
`protected StatementBuffer` | `buildInitialSelect(SelectManager selectManager)` Builds the initial SELECT statement.
`FeatureCollection` | `performQuery()` Performs the associated `Query` against the datastore.

Methods inherited from class org.deegree.io.datastore.sql.FeatureFetcher
`appendQualifiedContentList, buildResultPosMap, determineFetchContents, extractFeature, extractFeatureId`

Methods inherited from class org.deegree.io.datastore.sql.AbstractRequestHandler
`appendColumnsList, appendFeatureIdColumns, appendFeatureIdConstraint, appendFeatureIdConstraint, appendJoinCondition, appendJoins, appendQualifiedColumn, appendQualifiedColumnsList, determineAffectedAndModifiableFIDs, determineAffectedFIDs, determineSubFeatures, determineSuperFeatures, extractFeatureId, extractFeatureIds, extractFeatureIdsForceUnique`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### QueryHandler

    public QueryHandler(AbstractSQLDatastore ds,
                        TableAliasGenerator aliasGenerator,
                        Connection conn,
                        MappedFeatureType[] rootFts,
                        Query query)
                 throws DatastoreException

  Creates a new instance of `QueryHandler` from the given parameters.

  Parameters:
    `ds` - datastore that spawned this QueryHandler
    `aliasGenerator` - used to generate unique aliases for the tables in the SELECT statements
    `conn` - JDBCConnection to execute the generated SELECT statements against
    `rootFts` - the root feature types that are queried, more than one type means that the types are joined
    `query` - query to perform
  Throws:
    `DatastoreException`

Method Detail

### performQuery

    public FeatureCollection performQuery()
                                   throws SQLException,
                                          DatastoreException,
                                          UnknownCRSException

  Performs the associated `Query` against the datastore.

  Returns:
    collection of requested features
  Throws:
    `SQLException` - if a JDBC error occurs
    `DatastoreException`
    `UnknownCRSException`

### buildInitialSelect

    protected StatementBuffer buildInitialSelect(SelectManager selectManager)
                                          throws DatastoreException

  Builds the initial SELECT statement.

  This statement determines all feature ids that are affected by the filter, but also SELECTs all properties that are stored in the root feature types' tables (to improve efficiency).

  The statement is structured like this:

  - `SELECT`
  - comma-separated list of qualified columns/functions to fetch from root tables
  - `FROM`
  - comma-separated list of tables and their aliases (this is needed to constrain the paths to selected XPath-PropertyNames)
  - `WHERE`
  - SQL representation of the filter expression
  - `ORDER BY`
  - qualified sort criteria columns/functions

  Parameters:
    `selectManager` - associated `SelectManager`
  Returns:
    initial select statement
  Throws:
    `DatastoreException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| deegree 2.4 (2010/11/11 10:47 build-27-official)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org