public class DB2FilterToSQL extends PreparedFilterToSQL
The following spatial filter operations are supported:
FilterToSQL.FieldEncoderdescriptors, dialect, dimensions, literalTypes, literalValues, SRIDscapabilities, currentDimension, currentGeometry, currentSRID, databaseSchema, encodingFunction, featureType, fieldEncoder, filterFactory, inEncodingEnabled, inline, IO_ERROR, out, primaryKey, sqlNameEscape| Constructor and Description |
|---|
DB2FilterToSQL(PreparedStatementSQLDialect dialect) |
DB2FilterToSQL(Writer out) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addSelectivity() |
protected FilterCapabilities |
createFilterCapabilities()
Sets the DB2 filter capabilities.
|
String |
db2Geom(Geometry geom)
Construct a geometry from the WKT representation of a geometry
|
HashMap<Class<?>,String> |
getPredicateMap() |
boolean |
isFunctionEncodingEnabled() |
boolean |
isLooseBBOXEnabled() |
void |
setFunctionEncodingEnabled(boolean functionEncodingEnabled) |
void |
setLooseBBOXEnabled(boolean looseBBOXEnabled) |
void |
setSelectivityClause(String string)
Sets a SELECTIVITY clause that can be included with the spatial predicate to influence the
query optimizer to exploit a spatial index if it exists.
|
Object |
visit(ExcludeFilter filter,
Object extraData)
Visit
Filter.EXCLUDE (often used during data structure transformations). |
Object |
visit(Function function,
Object extraData)
Writes sql for a function expression.
|
Object |
visit(IncludeFilter filter,
Object extraData)
Visit
Filter.INCLUDE (often used during data structure transformations). |
protected Object |
visitBinarySpatialOperator(BinarySpatialOperator filter,
Expression e1,
Expression e2,
boolean swapped,
Object extraData) |
protected Object |
visitBinarySpatialOperator(BinarySpatialOperator filter,
Expression e1,
Expression e2,
Object extraData)
Handles the more general case of two generic expressions.
|
protected Object |
visitBinarySpatialOperator(BinarySpatialOperator filter,
PropertyName property,
Literal geometry,
boolean swapped,
Object extraData)
Handles the common case of a PropertyName,Literal geometry binary spatial operator.
|
boolean |
visitFunction(Function function,
Object extraData)
Performs custom visits for functions that cannot be encoded as
functionName(p1, p2, ... pN). |
void |
visitLiteralGeometry(Literal expression)
Construct the appropriate geometry type from the WKT representation of a literal expression
|
protected void |
writeLiteral(Object literal)
Writes out a non null, non geometry literal.
|
convertEnvelopeToPolygon, getDescriptors, getDimensions, getLiteralTypes, getLiteralValues, getSRIDs, isPrepareEnabled, setPrepareEnabled, visit, visitcast, encode, encode, encodeBinaryComparisonOperator, encodeToString, encodeToString, escapeName, evaluateLiteral, getCapabilities, getDatabaseSchema, getDistanceInMeters, getDistanceInNativeUnits, getExpressionType, getFeatureType, getFunctionName, getFunctionReturnType, getParameter, getPrimaryKey, getReferenceGeometryCentroid, getSqlNameEscape, isBinaryExpression, isInEncodingEnabled, setCapabilities, setDatabaseSchema, setFeatureType, setFieldEncoder, setInEncodingEnabled, setInline, setPrimaryKey, setSqlNameEscape, setWriter, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitBinaryComparisonOperator, visitBinarySpatialOperator, visitBinaryTemporalOperator, visitBinaryTemporalOperator, visitBinaryTemporalOperator, visitInFunction, visitLiteralTimePeriod, visitNullFilter, writeBinaryExpression, writeBinaryExpressionMemberpublic DB2FilterToSQL(PreparedStatementSQLDialect dialect)
public DB2FilterToSQL(Writer out)
public String db2Geom(Geometry geom)
geom - the constructor for the geometry.protected FilterCapabilities createFilterCapabilities()
createFilterCapabilities in class FilterToSQLpublic void setSelectivityClause(String string)
The parameter should be of the form:
"SELECTIVITY 0.001"
where the numeric value is the fraction of rows that will be returned by using the index
scan. This doesn't have to be true. The value 0.001 is typically used to force the use of the
spatial in all cases if the spatial index exists.
string - a selectivity clauseprotected Object visitBinarySpatialOperator(BinarySpatialOperator filter, PropertyName property, Literal geometry, boolean swapped, Object extraData)
FilterToSQLvisitBinarySpatialOperator in class FilterToSQLprotected Object visitBinarySpatialOperator(BinarySpatialOperator filter, Expression e1, Expression e2, Object extraData)
FilterToSQLThe most common case is two PropertyName expressions, which happens during a spatial join.
visitBinarySpatialOperator in class FilterToSQLprotected Object visitBinarySpatialOperator(BinarySpatialOperator filter, Expression e1, Expression e2, boolean swapped, Object extraData)
public void visitLiteralGeometry(Literal expression) throws IOException
visitLiteralGeometry in class FilterToSQLexpression - the expression turn into a geometry constructor.IOException - Passes back exception if generated by this.out.write()protected void addSelectivity()
throws IOException
IOExceptionpublic Object visit(ExcludeFilter filter, Object extraData)
FilterVisitorFilter.EXCLUDE (often used during data structure transformations).visit in interface FilterVisitorvisit in class FilterToSQLfilter - the filter to be visitedextraData - Value object provided to visitorFilterVisitor#visit(ExcludeFilter, Object)}
Writes the SQL for the IncludeFilter by writing "FALSE".
public Object visit(IncludeFilter filter, Object extraData)
FilterVisitorFilter.INCLUDE (often used during data structure transformations).visit in interface FilterVisitorvisit in class FilterToSQLfilter - the filter to be visitedextraData - Value object provided to visitorFilterVisitor#visit(IncludeFilter, Object)}
Writes the SQL for the IncludeFilter by writing "TRUE".
public boolean isLooseBBOXEnabled()
public void setLooseBBOXEnabled(boolean looseBBOXEnabled)
protected void writeLiteral(Object literal) throws IOException
FilterToSQLwriteLiteral in class FilterToSQLIOExceptionpublic boolean isFunctionEncodingEnabled()
public void setFunctionEncodingEnabled(boolean functionEncodingEnabled)
public boolean visitFunction(Function function, Object extraData) throws IOException
functionName(p1, p2, ... pN).IOExceptionpublic Object visit(Function function, Object extraData) throws RuntimeException
FilterToSQLvisit in interface ExpressionVisitorvisit in class FilterToSQLfunction - a function expressionRuntimeException - If an IO error occurs.FilterToSQL.getFunctionName(Function)Copyright © 1996–2021 Geotools. All rights reserved.