deegree 2.5 (2011/06/29 09:44 build-8-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: 23718 $
Author:
Christoph Pollmann, last edited by: $Author: mschneider $

Field Summary
protected  java.util.Map<java.lang.String,Feature> featureMap
          key: feature id value, value: Feature
protected  java.util.Set<FeatureId> featuresInGeneration
          key: feature id of features that are generated or are in generation
protected  PropertyPath[] propertyNames
          requested properties of the feature type
protected  MappedFeatureType rootFeatureType
          requested feature type
protected  SDEWhereBuilder whereBuilder
          used to build the initial SELECT (especially the WHERE-clause)
 
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(java.lang.String[] columns)
          Builds the initial SELECT statement.
protected  Feature extractFeature(FeatureId fid, MappedFeatureType featureType, java.util.Map<MappedPropertyType,java.util.Collection<PropertyPath>> requestedPropertyMap, java.util.Map<MappingField,java.lang.Integer> mappingFieldsMap, java.lang.Object[] resultValues)
          Extracts a feature from the values of a result set row.
protected  FeatureId extractFeatureId(MappedFeatureType ft, java.util.Map<MappingField,java.lang.Integer> mappingFieldMap, java.lang.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
requested feature type


propertyNames

protected PropertyPath[] propertyNames
requested properties of the feature type


whereBuilder

protected SDEWhereBuilder whereBuilder
used to build the initial SELECT (especially the WHERE-clause)


featuresInGeneration

protected java.util.Set<FeatureId> featuresInGeneration
key: feature id of features that are generated or are in generation


featureMap

protected java.util.Map<java.lang.String,Feature> featureMap
key: feature id value, value: Feature

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(java.lang.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:
the initial query

extractFeature

protected Feature extractFeature(FeatureId fid,
                                 MappedFeatureType featureType,
                                 java.util.Map<MappedPropertyType,java.util.Collection<PropertyPath>> requestedPropertyMap,
                                 java.util.Map<MappingField,java.lang.Integer> mappingFieldsMap,
                                 java.lang.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:
DatastoreException

extractFeatureId

protected FeatureId extractFeatureId(MappedFeatureType ft,
                                     java.util.Map<MappingField,java.lang.Integer> mappingFieldMap,
                                     java.lang.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.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