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.sde
Class SDEQueryHandler

    java.lang.Object
      org.deegree.io.datastore.sde.AbstractSDERequestHandler
          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 Map<String,Feature>` | `featureMap` key: feature id value, value: Feature
`protected 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(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<MappingField,Integer> 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

  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 Set<FeatureId> featuresInGeneration

  key: feature id of features that are generated or are in generation

### featureMap

    protected Map<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(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:

  - `SELECT`
  - comma-separated list of selected qualified fields
  - `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 fields

  Parameters:
    `columns` -
  Returns:
    the initial query

### 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 `MappedPropertyType`s mapped to `Collection` of `PropertyPath`s
    `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,
                                         Map<MappingField,Integer> 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

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