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: 29956 $, $Date: 2011-03-09 14:51:48 +0100 (Wed, 09 Mar 2011) $
 
- Author:
 
  - Markus Schneider , last edited by: $Author: apoth $
 
- See Also:
 FeatureFetcher, 
AbstractSQLDatastore, 
QueryTableTree
 
 
 
 
 
 
| 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 | 
 
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 QueryHandleraliasGenerator - used to generate unique aliases for the tables in the SELECT statementsconn - JDBCConnection to execute the generated SELECT statements againstrootFts - the root feature types that are queried, more than one type means that the types are joinedquery - query to perform
- Throws:
 DatastoreException
 
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
 
 
                an open source project founded by lat/lon, Bonn, Germany.
                    For more information visit: http://www.deegree.org