Package org.geotools.data.oracle
Class OracleFilterToSQL
- Object
-
- FilterToSQL
-
- PreparedFilterToSQL
-
- OracleFilterToSQL
-
- All Implemented Interfaces:
ExpressionVisitor
,FilterVisitor
public class OracleFilterToSQL extends PreparedFilterToSQL
Oracle specific filter encoder.- Author:
- Justin Deoliveira, OpenGEO, Andrea Aime, OpenGEO, Davide Savazzi, GeoSolutions
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class FilterToSQL
FilterToSQL.FieldEncoder
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
looseBBOXEnabled
Whether BBOX should be encoded as just a primary filter or primary+secondary-
Fields inherited from class PreparedFilterToSQL
descriptors, dialect, dimensions, literalTypes, literalValues, SRIDs
-
Fields inherited from class FilterToSQL
capabilities, currentDimension, currentGeometry, currentSRID, databaseSchema, encodingFunction, escapeBackslash, featureType, fieldEncoder, filterFactory, inEncodingEnabled, inline, IO_ERROR, LOGGER, out, primaryKey, sqlNameEscape
-
-
Constructor Summary
Constructors Constructor Description OracleFilterToSQL(PreparedStatementSQLDialect dialect)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> void
accumulateGeometries(List<T> collection, Geometry g, Class<? extends T> target)
protected FilterCapabilities
createFilterCapabilities()
Sets the capabilities of this filter.protected Geometry
distillSameTypeGeometries(GeometryCollection coll, Geometry original)
protected void
doSDODistance(BinarySpatialOperator filter, Expression e1, Expression e2, Object extraData)
protected void
doSDOFilter(Filter filter, Expression e1, Expression e2, Object extraData)
protected void
doSDORelate(Filter filter, Expression e1, Expression e2, boolean swapped, Object extraData)
Encodes an SDO relateprotected void
encodeBinaryComparisonOperator(BinaryComparisonOperator filter, Object extraData, Expression left, Expression right, Class leftContext, Class rightContext)
Encode a BinaryComparisonOperator to SQLString
escapeName(String name)
Surrounds a name with the SQL escape string.boolean
isLooseBBOXEnabled()
String
jsonExists(Function function)
void
setLooseBBOXEnabled(boolean looseBBOXEnabled)
Object
visit(Function function, Object extraData)
Writes sql for a function expression.Object
visit(PropertyIsEqualTo filter, Object extraData)
Write the SQL for this kind of filterprotected 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.protected void
visitLiteralGeometry(Literal expression)
Subclasses must implement this method in order to encode geometry filters according to the specific database implementation-
Methods inherited from class PreparedFilterToSQL
convertEnvelopeToPolygon, getDescriptors, getDimensions, getLiteralTypes, getLiteralValues, getSRIDs, isPrepareEnabled, setPrepareEnabled, visit, visit
-
Methods inherited from class FilterToSQL
cast, encode, encode, encodeToString, encodeToString, escapeLiteral, evaluateLiteral, getCapabilities, getDatabaseSchema, getDistanceInNativeUnits, getExpressionType, getFeatureType, getFunctionName, getFunctionReturnType, getParameter, getPrimaryKey, getSqlNameEscape, isBinaryExpression, isEscapeBackslash, isInEncodingEnabled, setCapabilities, setDatabaseSchema, setEscapeBackslash, 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, visit, visitBinaryComparisonOperator, visitBinarySpatialOperator, visitBinaryTemporalOperator, visitBinaryTemporalOperator, visitBinaryTemporalOperator, visitInFunction, visitLiteralTimePeriod, visitNullFilter, writeBinaryExpression, writeBinaryExpressionMember, writeLiteral
-
-
-
-
Constructor Detail
-
OracleFilterToSQL
public OracleFilterToSQL(PreparedStatementSQLDialect dialect)
-
-
Method Detail
-
isLooseBBOXEnabled
public boolean isLooseBBOXEnabled()
-
setLooseBBOXEnabled
public void setLooseBBOXEnabled(boolean looseBBOXEnabled)
-
createFilterCapabilities
protected FilterCapabilities createFilterCapabilities()
Description copied from class:FilterToSQL
Sets the capabilities of this filter.- Overrides:
createFilterCapabilities
in classFilterToSQL
- Returns:
- FilterCapabilities for this Filter
-
visit
public Object visit(PropertyIsEqualTo filter, Object extraData)
Description copied from class:FilterToSQL
Write the SQL for this kind of filter- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classFilterToSQL
- Parameters:
filter
- the filter to visitextraData
- extra data (unused by this method)
-
visit
public Object visit(Function function, Object extraData)
Description copied from class:FilterToSQL
Writes sql for a function expression. By default it will write the call by using the same arguments provided to the GeoTools function, subclasses should override on a case by case basis if this behavior is not the desired one.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classFilterToSQL
- Parameters:
function
- a function expression- See Also:
FilterToSQL.getFunctionName(Function)
-
visitBinarySpatialOperator
protected Object visitBinarySpatialOperator(BinarySpatialOperator filter, PropertyName property, Literal geometry, boolean swapped, Object extraData)
Description copied from class:FilterToSQL
Handles the common case of a PropertyName,Literal geometry binary spatial operator.- Overrides:
visitBinarySpatialOperator
in classFilterToSQL
-
visitBinarySpatialOperator
protected Object visitBinarySpatialOperator(BinarySpatialOperator filter, Expression e1, Expression e2, Object extraData)
Description copied from class:FilterToSQL
Handles the more general case of two generic expressions.The most common case is two PropertyName expressions, which happens during a spatial join.
- Overrides:
visitBinarySpatialOperator
in classFilterToSQL
-
visitBinarySpatialOperator
protected Object visitBinarySpatialOperator(BinarySpatialOperator filter, Expression e1, Expression e2, boolean swapped, Object extraData)
-
distillSameTypeGeometries
protected Geometry distillSameTypeGeometries(GeometryCollection coll, Geometry original)
-
accumulateGeometries
protected <T> void accumulateGeometries(List<T> collection, Geometry g, Class<? extends T> target)
-
doSDOFilter
protected void doSDOFilter(Filter filter, Expression e1, Expression e2, Object extraData) throws IOException
- Throws:
IOException
-
doSDORelate
protected void doSDORelate(Filter filter, Expression e1, Expression e2, boolean swapped, Object extraData) throws IOException
Encodes an SDO relate- Throws:
IOException
-
doSDODistance
protected void doSDODistance(BinarySpatialOperator filter, Expression e1, Expression e2, Object extraData) throws IOException
- Throws:
IOException
-
escapeName
public String escapeName(String name)
Description copied from class:FilterToSQL
Surrounds a name with the SQL escape string.If the name contains the SQL escape string, the SQL escape string is duplicated.
- Overrides:
escapeName
in classFilterToSQL
-
encodeBinaryComparisonOperator
protected void encodeBinaryComparisonOperator(BinaryComparisonOperator filter, Object extraData, Expression left, Expression right, Class leftContext, Class rightContext)
Description copied from class:FilterToSQL
Encode a BinaryComparisonOperator to SQL- Overrides:
encodeBinaryComparisonOperator
in classFilterToSQL
- Parameters:
filter
- the comparison operator to be turned to SQLextraData
- extraDataleft
- left parameter of the binary operatorright
- right parameter of the binary operatorleftContext
- expression type of the right parameter used as context for the left parameterrightContext
- expression type of the left parameter used as context for the right parameter
-
visitLiteralGeometry
protected void visitLiteralGeometry(Literal expression) throws IOException
Description copied from class:FilterToSQL
Subclasses must implement this method in order to encode geometry filters according to the specific database implementation- Overrides:
visitLiteralGeometry
in classFilterToSQL
- Throws:
IOException
-
-