deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.io.datastore.sde
Class SDEWhereBuilder

java.lang.Object
  extended by org.deegree.io.datastore.sde.SDEWhereBuilder

public class SDEWhereBuilder
extends java.lang.Object

WhereBuilder implementation for ArcSDE.

Version:
$Revision: 12183 $, $Date: 2008-06-05 11:17:23 +0200 (Do, 05 Jun 2008) $
Author:
Christoph Pollmann, last edited by: $Author: rbezema $

Field Summary
protected  Filter filter
          The filter to apply
protected  java.util.List<PropertyPath> filterPropertyPaths
          The filter property paths
protected  QueryTableTree queryTableTree
          The query
protected  MappedFeatureType rootFeatureType
          the root feature type
 
Constructor Summary
SDEWhereBuilder(MappedFeatureType[] rootFts, java.lang.String[] aliases, Filter filter, TableAliasGenerator aliasGenerator)
          Creates a new instance of SDEWhereBuilder for the given parameters.
 
Method Summary
protected  void appendArithmeticExpressionAsSQL(java.lang.StringBuffer query, ArithmeticExpression expression, int targetSqlType)
          Appends an SQL fragment for the given object to the given sql statement.
protected  void appendComparisonOperationAsSQL(java.lang.StringBuffer query, ComparisonOperation operation)
          Appends an SQL fragment for the given object to the given sql statement.
protected  void appendComplexFilterAsSQL(java.lang.StringBuffer query, ComplexFilter filter)
          Appends an SQL fragment for the given object.
protected  void appendExpressionAsSQL(java.lang.StringBuffer query, Expression expression, int targetSqlType)
          Appends an SQL fragment for the given object to the given sql statement.
protected  void appendFeatureFilterAsSQL(java.lang.StringBuffer query, FeatureFilter filter)
          Appends an SQL fragment for the given object to the given sql statement.
protected  void appendFunctionAsSQL(java.lang.StringBuffer query, Function function, int targetSqlType)
          Appends an SQL fragment for the given object to the given sql statement.
protected  void appendLiteralAsSQL(java.lang.StringBuffer query, Literal literal, int targetSqlType)
          Appends an SQL fragment for the given object to the given sql statement.
protected  void appendLogicalOperationAsSQL(java.lang.StringBuffer query, LogicalOperation operation)
          Appends an SQL fragment for the given object to the given sql statement.
protected  void appendOperationAsSQL(java.lang.StringBuffer query, Operation operation)
          Appends an SQL fragment for the given object to the given sql statement.
protected  void appendPropertyIsBetweenOperationAsSQL(java.lang.StringBuffer query, PropertyIsBetweenOperation operation)
          Appends an SQL fragment for the given object to the given sql statement.
protected  void appendPropertyIsCOMPOperationAsSQL(java.lang.StringBuffer query, PropertyIsCOMPOperation operation)
          Appends an SQL fragment for the given object to the given sql statement.
protected  void appendPropertyIsLikeOperationAsSQL(java.lang.StringBuffer query, PropertyIsLikeOperation operation)
          Appends an SQL fragment for the given object to the given sql statement.
protected  void appendPropertyIsNullOperationAsSQL(java.lang.StringBuffer query, PropertyIsNullOperation operation)
          Appends an SQL fragment for the given object to the given sql statement.
protected  void appendPropertyNameAsSQL(java.lang.StringBuffer query, PropertyName propertyName)
          Appends an SQL fragment for the given object to the given sql statement.
 void appendWhereCondition(java.lang.StringBuffer whereCondition)
          Appends the SQL condition from the Filter to the given sql statement.
protected  void buildFilterPropertyNameMap()
           
protected  com.esri.sde.sdk.client.SeFilter[] buildSpatialFilter(ComplexFilter filter, java.util.List<com.esri.sde.sdk.client.SeLayer> layers)
          Generates an SQL-fragment for the given object.
 Filter getFilter()
           
protected  int getInternalSRS(SpatialOperation operation)
          Returns the internal (database specific) SRS code used in the geometry field of the given SpatialOperation.
protected  MappingField getPropertyNameMapping(PropertyName propertyName)
          Appends an SQL fragment for the given object to the given sql statement.
protected  int getPropertyNameSQLType(PropertyName propertyName)
           
 java.lang.String getRootTableAlias()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootFeatureType

protected MappedFeatureType rootFeatureType
the root feature type


filter

protected Filter filter
The filter to apply


queryTableTree

protected QueryTableTree queryTableTree
The query


filterPropertyPaths

protected java.util.List<PropertyPath> filterPropertyPaths
The filter property paths

Constructor Detail

SDEWhereBuilder

public SDEWhereBuilder(MappedFeatureType[] rootFts,
                       java.lang.String[] aliases,
                       Filter filter,
                       TableAliasGenerator aliasGenerator)
                throws DatastoreException
Creates a new instance of SDEWhereBuilder for the given parameters.

Parameters:
rootFts - selected feature types, more than one type means that the types are joined
aliases - aliases for the feature types, may be null (must have same length as rootFts otherwise)
filter -
aliasGenerator -
Throws:
DatastoreException
Method Detail

getRootTableAlias

public java.lang.String getRootTableAlias()
Returns:
the alias

getFilter

public Filter getFilter()
Returns:
filter

getInternalSRS

protected int getInternalSRS(SpatialOperation operation)
Returns the internal (database specific) SRS code used in the geometry field of the given SpatialOperation.

Parameters:
operation - SpatialOperation for which the internal SRS is needed
Returns:
the internal (database specific) SRS code.

getPropertyNameSQLType

protected int getPropertyNameSQLType(PropertyName propertyName)
Parameters:
propertyName -
Returns:
the type of the property name as an int

buildFilterPropertyNameMap

protected void buildFilterPropertyNameMap()
                                   throws PropertyPathResolvingException
Throws:
PropertyPathResolvingException

appendWhereCondition

public final void appendWhereCondition(java.lang.StringBuffer whereCondition)
Appends the SQL condition from the Filter to the given sql statement.

Parameters:
whereCondition -

appendComplexFilterAsSQL

protected void appendComplexFilterAsSQL(java.lang.StringBuffer query,
                                        ComplexFilter filter)
Appends an SQL fragment for the given object.

Parameters:
query -
filter -

appendOperationAsSQL

protected void appendOperationAsSQL(java.lang.StringBuffer query,
                                    Operation operation)
Appends an SQL fragment for the given object to the given sql statement.

Parameters:
query -
operation -

appendComparisonOperationAsSQL

protected void appendComparisonOperationAsSQL(java.lang.StringBuffer query,
                                              ComparisonOperation operation)
Appends an SQL fragment for the given object to the given sql statement.

Parameters:
query -
operation -

appendPropertyIsCOMPOperationAsSQL

protected void appendPropertyIsCOMPOperationAsSQL(java.lang.StringBuffer query,
                                                  PropertyIsCOMPOperation operation)
Appends an SQL fragment for the given object to the given sql statement.

Parameters:
query -
operation -

appendPropertyIsLikeOperationAsSQL

protected void appendPropertyIsLikeOperationAsSQL(java.lang.StringBuffer query,
                                                  PropertyIsLikeOperation operation)
Appends an SQL fragment for the given object to the given sql statement. Replacing and escape handling is based on a finite automaton with 2 states:

(escapeMode)

NOTE: Currently, the method uses a quirk and appends the generated argument inline, i.e. not using query.addArgument(). This is because of a problem that occurred for example in Postgresql; the execution of the inline version is *much* faster (at least with version 8.0).

Parameters:
query -
operation -

appendPropertyIsNullOperationAsSQL

protected void appendPropertyIsNullOperationAsSQL(java.lang.StringBuffer query,
                                                  PropertyIsNullOperation operation)
Appends an SQL fragment for the given object to the given sql statement.

Parameters:
query -
operation -

appendPropertyIsBetweenOperationAsSQL

protected void appendPropertyIsBetweenOperationAsSQL(java.lang.StringBuffer query,
                                                     PropertyIsBetweenOperation operation)
Appends an SQL fragment for the given object to the given sql statement.

Parameters:
query -
operation -

appendExpressionAsSQL

protected void appendExpressionAsSQL(java.lang.StringBuffer query,
                                     Expression expression,
                                     int targetSqlType)
Appends an SQL fragment for the given object to the given sql statement.

Parameters:
query -
expression -
targetSqlType - sql type code to be used for literals at the bottom of the expression tree

appendLiteralAsSQL

protected void appendLiteralAsSQL(java.lang.StringBuffer query,
                                  Literal literal,
                                  int targetSqlType)
Appends an SQL fragment for the given object to the given sql statement.

Parameters:
query -
literal -
targetSqlType -

getPropertyNameMapping

protected MappingField getPropertyNameMapping(PropertyName propertyName)
Appends an SQL fragment for the given object to the given sql statement.

Parameters:
propertyName -
Returns:
the field mapped from the propertyname

appendPropertyNameAsSQL

protected void appendPropertyNameAsSQL(java.lang.StringBuffer query,
                                       PropertyName propertyName)
Appends an SQL fragment for the given object to the given sql statement.

Parameters:
query -
propertyName -

appendArithmeticExpressionAsSQL

protected void appendArithmeticExpressionAsSQL(java.lang.StringBuffer query,
                                               ArithmeticExpression expression,
                                               int targetSqlType)
Appends an SQL fragment for the given object to the given sql statement.

Parameters:
query -
expression -
targetSqlType -

appendFunctionAsSQL

protected void appendFunctionAsSQL(java.lang.StringBuffer query,
                                   Function function,
                                   int targetSqlType)
Appends an SQL fragment for the given object to the given sql statement.

Parameters:
query -
function -
targetSqlType -

appendLogicalOperationAsSQL

protected void appendLogicalOperationAsSQL(java.lang.StringBuffer query,
                                           LogicalOperation operation)
Appends an SQL fragment for the given object to the given sql statement.

Parameters:
query -
operation -

appendFeatureFilterAsSQL

protected void appendFeatureFilterAsSQL(java.lang.StringBuffer query,
                                        FeatureFilter filter)
Appends an SQL fragment for the given object to the given sql statement. TODO Handle compound primary keys correctly.

Parameters:
query -
filter -

buildSpatialFilter

protected com.esri.sde.sdk.client.SeFilter[] buildSpatialFilter(ComplexFilter filter,
                                                                java.util.List<com.esri.sde.sdk.client.SeLayer> layers)
                                                         throws DatastoreException
Generates an SQL-fragment for the given object.

Parameters:
filter -
layers -
Returns:
the complex filters as se filters.
Throws:
DatastoreException

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