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.sql
Class FeatureFetcher

    java.lang.Object
      org.deegree.io.datastore.sql.AbstractRequestHandler
          org.deegree.io.datastore.sql.FeatureFetcher

Direct Known Subclasses:
  QueryHandler

    abstract class FeatureFetcher

extends AbstractRequestHandler

The only implementation of this abstract class is the `QueryHandler` class.

While the `QueryHandler` class performs the initial SELECT, `FeatureFetcher` is responsible for any subsequent SELECTs that may be necessary.

Version:
  $Revision: 23693 $, $Date: 2010-04-20 14:33:55 +0200 (Di, 20. Apr 2010) $
Author:
  Markus Schneider, last edited by: $Author: hrubach $
See Also:
  `QueryHandler`

Field Summary
`protected Map<FeatureId,Feature>` | `featureMap`
`protected Set<FeatureId>` | `featuresInGeneration`
`protected Map<FeatureId,List<FeatureProperty>>` | `fidToPropertyMap`
`protected Query` | `query`
`protected VirtualContentProvider` | `vcProvider`

Fields inherited from class org.deegree.io.datastore.sql.AbstractRequestHandler
`aliasGenerator, conn, datastore, FT_COLUMN, FT_PREFIX`

Constructor Summary
`FeatureFetcher(AbstractSQLDatastore datastore, TableAliasGenerator aliasGenerator, Connection conn, Query query)`

Method Summary
`protected void` | `appendQualifiedContentList(StatementBuffer query, String tableAlias, List<List<SimpleContent>> fetchContents)`
`protected Map<SimpleContent,Integer>` | `buildResultPosMap(List<List<SimpleContent>> fetchContents)` Builds a lookup map that allows to find the index (position in the `ResultSet`) by the `SimpleContent` instance that makes it necessary to fetch it.
`protected List<List<SimpleContent>>` | `determineFetchContents(MappedFeatureType ft, PropertyType[] requestedProps)` Determines the columns / functions that have to be fetched from the table of the given `MappedFeatureType` and associates identical columns / functions to avoid that the same column / function is SELECTed more than once.
`protected Feature` | `extractFeature(FeatureId fid, Map<MappedPropertyType,Collection<PropertyPath>> requestedPropertyMap, Map<SimpleContent,Integer> resultPosMap, Object[] resultValues)` Extracts a feature from the values of a result set row.
`protected FeatureId` | `extractFeatureId(MappedFeatureType ft, Map<SimpleContent,Integer> mfMap, Object[] resultValues)` Extracts the feature id from the values of a result set row.

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`

Field Detail

### featuresInGeneration

    protected Set<FeatureId> featuresInGeneration

### featureMap

    protected Map<FeatureId,Feature> featureMap

### fidToPropertyMap

    protected Map<FeatureId,List<FeatureProperty>> fidToPropertyMap

### vcProvider

    protected VirtualContentProvider vcProvider

### query

    protected Query query

Constructor Detail

### FeatureFetcher

    FeatureFetcher(AbstractSQLDatastore datastore,
                   TableAliasGenerator aliasGenerator,
                   Connection conn,
                   Query query)
             throws DatastoreException

Throws:
  `DatastoreException`

Method Detail

### extractFeature

    protected Feature extractFeature(FeatureId fid,
                                     Map<MappedPropertyType,Collection<PropertyPath>> requestedPropertyMap,
                                     Map<SimpleContent,Integer> resultPosMap,
                                     Object[] resultValues)
                              throws SQLException,
                                     DatastoreException,
                                     UnknownCRSException

  Extracts a feature from the values of a result set row.

  Parameters:
    `fid` - feature id of the feature
    `requestedPropertyMap` - requested `MappedPropertyType`s mapped to `Collection` of `PropertyPath`s
    `resultPosMap` - 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:
    `SQLException` - if a JDBC related error occurs
    `DatastoreException`
    `UnknownCRSException`

### extractFeatureId

    protected FeatureId extractFeatureId(MappedFeatureType ft,
                                         Map<SimpleContent,Integer> mfMap,
                                         Object[] resultValues)
                                  throws DatastoreException

  Extracts the feature id from the values of a result set row.

  Parameters:
    `ft` - feature type for which the id shall be extracted
    `mfMap` - 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
  Throws:
    `DatastoreException`

### determineFetchContents

    protected List<List<SimpleContent>> determineFetchContents(MappedFeatureType ft,
                                                               PropertyType[] requestedProps)
                                                        throws DatastoreException

  Determines the columns / functions that have to be fetched from the table of the given `MappedFeatureType` and associates identical columns / functions to avoid that the same column / function is SELECTed more than once.

  Identical columns are put into the same (inner) list.

  The following `SimpleContent` instances of the `MappedFeatureType`s annotation are used to build the list:

  - MappingFields from the wfs:gmlId - annotation element of the feature type definition
  - MappingFields in the annotations of the property element definitions; if the property's content is stored in a related table, the MappingFields used in the first wfs:Relation element's wfs:From element are considered
  - SQLFunctionCalls in the annotations of the property element definitions; if the property's (derived) content is stored in a related table, the MappingFields used in the first wfs:Relation element's wfs:From element are considered

  Parameters:
    `ft` - feature type for which the content list is built
    `requestedProps` - requested properties
  Returns:
    List of Lists (that contains SimpleContent instance that refer the same column)
  Throws:
    `DatastoreException`

### appendQualifiedContentList

    protected void appendQualifiedContentList(StatementBuffer query,
                                              String tableAlias,
                                              List<List<SimpleContent>> fetchContents)

### buildResultPosMap

    protected Map<SimpleContent,Integer> buildResultPosMap(List<List<SimpleContent>> fetchContents)

  Builds a lookup map that allows to find the index (position in the `ResultSet`) by the `SimpleContent` instance that makes it necessary to fetch it.

  Parameters:
    `fetchContents` -
  Returns:
    key: SimpleContent, value: Integer (position in ResultSet)

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