deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.io.datastore.sql
Class QueryHandler

java.lang.Object
  extended by org.deegree.io.datastore.sql.AbstractRequestHandler
      extended by org.deegree.io.datastore.sql.FeatureFetcher
          extended by 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, java.sql.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,
                    java.sql.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 java.sql.SQLException,
                                      DatastoreException,
                                      UnknownCRSException
Performs the associated Query against the datastore.

Returns:
collection of requested features
Throws:
java.sql.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:

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

deegree 2.5 (2011/06/29 09:44 build-8-official)

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