deegree 2.2 (2008/12/22 11:33 build-3038-official)

org.deegree.io.datastore.sde
Class SDEQueryHandler

java.lang.Object
  extended by org.deegree.io.datastore.sde.AbstractSDERequestHandler
      extended by org.deegree.io.datastore.sde.SDEQueryHandler

public class SDEQueryHandler
extends AbstractSDERequestHandler

Special QueryHandler implementation for the SDEDatastore.

Version:
$Revision: 7844 $
Author:
Christoph Pollmann, last edited by: $Author: apoth $

Field Summary
protected  Map<String,Feature> featureMap
           
protected  Set<FeatureId> featuresInGeneration
           
protected  PropertyPath[] propertyNames
           
protected  MappedFeatureType rootFeatureType
           
protected  SDEWhereBuilder whereBuilder
           
 
Fields inherited from class org.deegree.io.datastore.sde.AbstractSDERequestHandler
aliasGenerator, conn, datastore, FT_COLUMN, FT_PREFIX
 
Constructor Summary
SDEQueryHandler(SDEDatastore datastore, TableAliasGenerator aliasGenerator, SDEConnection conn, MappedFeatureType[] rootFts, Query query)
          Creates a new instance of SDEQueryHandler from the given parameters.
 
Method Summary
protected  com.esri.sde.sdk.client.SeQuery buildInitialSelect(String[] columns)
          Builds the initial SELECT statement.
protected  Feature extractFeature(FeatureId fid, MappedFeatureType featureType, Map<MappedPropertyType,Collection<PropertyPath>> requestedPropertyMap, Map<MappingField,Integer> mappingFieldsMap, Object[] resultValues)
          Extracts a feature from the values of a result set row.
protected  FeatureId extractFeatureId(MappedFeatureType ft, Map mappingFieldMap, Object[] resultValues)
          Extracts the feature id from the values of a result set row.
 FeatureCollection performQuery()
          Performs the associated Query against the datastore.
protected  void resolveXLinks()
           
 
Methods inherited from class org.deegree.io.datastore.sde.AbstractSDERequestHandler
buildColumnsMap, buildInitialFIDSelect, buildMappingFieldMap, determineAffectedFIDs, extractFeatureIds, getAliasGenerator, getConnection, getDatastore, getFeatureIdColumns
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootFeatureType

protected MappedFeatureType rootFeatureType

propertyNames

protected PropertyPath[] propertyNames

whereBuilder

protected SDEWhereBuilder whereBuilder

featuresInGeneration

protected Set<FeatureId> featuresInGeneration

featureMap

protected Map<String,Feature> featureMap
Constructor Detail

SDEQueryHandler

public SDEQueryHandler(SDEDatastore datastore,
                       TableAliasGenerator aliasGenerator,
                       SDEConnection conn,
                       MappedFeatureType[] rootFts,
                       Query query)
                throws DatastoreException
Creates a new instance of SDEQueryHandler from the given parameters.

Parameters:
datastore - datastore that spawned this QueryHandler
aliasGenerator - used to generate unique aliases for the tables in the SELECT statements
conn - SDEConnection to execute the generated SELECT statements against
rootFts - queried feature types
query - Query to perform
Throws:
DatastoreException
Method Detail

performQuery

public FeatureCollection performQuery()
                               throws DatastoreException
Performs the associated Query against the datastore.

Returns:
collection of requested features
Throws:
DatastoreException

resolveXLinks

protected void resolveXLinks()
                      throws DatastoreException
Throws:
DatastoreException

buildInitialSelect

protected com.esri.sde.sdk.client.SeQuery buildInitialSelect(String[] columns)
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 type's table (to improve efficiency).

The statement is structured like this:

Parameters:
columns -
Returns:

extractFeature

protected Feature extractFeature(FeatureId fid,
                                 MappedFeatureType featureType,
                                 Map<MappedPropertyType,Collection<PropertyPath>> requestedPropertyMap,
                                 Map<MappingField,Integer> mappingFieldsMap,
                                 Object[] resultValues)
                          throws DatastoreException
Extracts a feature from the values of a result set row.

Parameters:
fid - feature id of the feature
featureType - feature type of the feature to be extracted
requestedPropertyMap - requested MappedPropertyTypes mapped to Collection of PropertyPaths
mappingFieldsMap - key class: MappingField, value class: Integer (this is the associated index in resultValues)
resultValues - all retrieved columns from one result set row
Returns:
the extracted feature
Throws:
GeometryException
DatastoreException

extractFeatureId

protected FeatureId extractFeatureId(MappedFeatureType ft,
                                     Map mappingFieldMap,
                                     Object[] resultValues)
Extracts the feature id from the values of a result set row.

Parameters:
ft - feature type for which the id shall be extracted
mappingFieldMap - key class: MappingField, value class: Integer (this is the associated index in resultValues)
resultValues - all retrieved columns from one result set row
Returns:
the feature id

deegree 2.2 (2008/12/22 11:33 build-3038-official)

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