org.deegree.sqldialect.postgis
Class PostGISWhereBuilder

java.lang.Object
  extended by org.deegree.sqldialect.filter.AbstractWhereBuilder
      extended by org.deegree.sqldialect.postgis.PostGISWhereBuilder

public class PostGISWhereBuilder
extends AbstractWhereBuilder

AbstractWhereBuilder implementation for PostGIS databases.

Version:
$Revision: 31186 $, $Date: 2011-07-01 18:01:58 +0200 (Fr, 01. Jul 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $

Field Summary
 
Fields inherited from class org.deegree.sqldialect.filter.AbstractWhereBuilder
aliasManager, dialect, filter, mapper, orderByClause, postFilter, postSortCrit, propNameMappingList, sortCrit, whereClause
 
Constructor Summary
PostGISWhereBuilder(PostGISDialect dialect, PropertyNameMapper mapper, OperatorFilter filter, SortProperty[] sortCrit, boolean allowPartialMappings, boolean useLegacyPredicates)
          Creates a new PostGISWhereBuilder instance.
 
Method Summary
protected  SQLOperation toProtoSQL(PropertyIsLike op)
          Translates the given PropertyIsLike into an SQLOperation.
protected  SQLOperation toProtoSQL(SpatialOperator op)
          Translates the given SpatialOperator into an SQLOperation.
 
Methods inherited from class org.deegree.sqldialect.filter.AbstractWhereBuilder
assertNotMultiValued, build, getAliasManager, getMappedPropertyNames, getOrderBy, getPostFilter, getPostSortCriteria, getWhere, toProtoSQL, toProtoSQL, toProtoSQL, toProtoSQL, toProtoSQL, toProtoSQL, toProtoSQL, toProtoSQL, toProtoSQL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostGISWhereBuilder

public PostGISWhereBuilder(PostGISDialect dialect,
                           PropertyNameMapper mapper,
                           OperatorFilter filter,
                           SortProperty[] sortCrit,
                           boolean allowPartialMappings,
                           boolean useLegacyPredicates)
                    throws FilterEvaluationException,
                           UnmappableException
Creates a new PostGISWhereBuilder instance.

Parameters:
dialect - SQL dialect, can be null (TODO refactor code, so not null is always used)
mapper - provides the mapping from ValueReferences to DB columns, must not be null
filter - Filter to use for generating the WHERE clause, can be null
sortCrit - criteria to use for generating the ORDER BY clause, can be null
allowPartialMappings - if false, any unmappable expression will cause an UnmappableException to be thrown
useLegacyPredicates - if true, legacy-style PostGIS spatial predicates are used (e.g. Intersects instead of ST_Intersects)
Throws:
FilterEvaluationException - if the expression contains invalid ValueReferences
UnmappableException - if allowPartialMappings is false and an expression could not be mapped to the db
Method Detail

toProtoSQL

protected SQLOperation toProtoSQL(PropertyIsLike op)
                           throws UnmappableException,
                                  FilterEvaluationException
Translates the given PropertyIsLike into an SQLOperation.

NOTE: This method appends the generated argument inline, i.e. not using a ?. This is because of a problem that has been observed with PostgreSQL 8.0; the execution of the inline version is *much* faster.

Overrides:
toProtoSQL in class AbstractWhereBuilder
Parameters:
op - comparison operator to be translated, must not be null
Returns:
corresponding SQL expression, never null
Throws:
UnmappableException - if translation is not possible (usually due to unmappable property names)
FilterEvaluationException - if the expression contains invalid ValueReferences

toProtoSQL

protected SQLOperation toProtoSQL(SpatialOperator op)
                           throws UnmappableException,
                                  FilterEvaluationException
Description copied from class: AbstractWhereBuilder
Translates the given SpatialOperator into an SQLOperation.

Specified by:
toProtoSQL in class AbstractWhereBuilder
Parameters:
op - spatial operator to be translated, must not be null
Returns:
corresponding SQL expression, never null
Throws:
UnmappableException - if translation is not possible (usually due to unmappable property names)
FilterEvaluationException - if the filter contains invalid ValueReferences


Copyright © 2011. All Rights Reserved.