Package org.geotools.jdbc
Class PreparedFilterToSQL
Object
FilterToSQL
PreparedFilterToSQL
- All Implemented Interfaces:
ExpressionVisitor
,FilterVisitor
- Direct Known Subclasses:
DB2FilterToSQL
,GeoPkgFilterToSQL
,H2GISPSFilterToSql
,HanaFilterToSQL
,OracleFilterToSQL
,PostgisPSFilterToSql
,TeradataFilterToSQL
Extension of FilterToSQL intended for use with prepared statements.
Each time a Literal
is visited, a '?' is encoded, and the value and type of the literal are stored,
available after the fact via getLiteralValues()
and getLiteralTypes()
.
- Author:
- Justin Deoliveira, OpenGEO, Andrea Aime, OpenGEO
-
Nested Class Summary
Nested classes/interfaces inherited from class FilterToSQL
FilterToSQL.FieldEncoder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<AttributeDescriptor>
protected PreparedStatementSQLDialect
ordered list of literal values encountered and their typesFields inherited from class FilterToSQL
capabilities, currentDimension, currentGeometry, currentSRID, databaseSchema, encodingFunction, escapeBackslash, featureType, fieldEncoder, filterFactory, inEncodingEnabled, inline, IO_ERROR, LOGGER, out, primaryKey, sqlNameEscape
-
Constructor Summary
ConstructorsConstructorDescriptionContructor taking a reference to the SQL dialect, will use it to encode geometry placeholders -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Returns the attribute descriptors compared to a given literal (if any, not always available, normally only needed if arrays are involved)Returns the list of dimensions for each literal tha happens to be a geometry, or null otherwisegetSRIDs()
Returns the list of native SRID for each literal that happens to be a geometry, or null otherwiseboolean
If true (default) a sql statement with literal placemarks is created, otherwise a normal statement is createdvoid
setPrepareEnabled
(boolean prepareEnabled) Export the contents of a Literal ExpresionEncodes an Id filterMethods inherited from class FilterToSQL
cast, createFilterCapabilities, encode, encode, encodeBinaryComparisonOperator, encodeToString, encodeToString, escapeLiteral, escapeName, evaluateLiteral, getCapabilities, getDatabaseSchema, getDistanceInNativeUnits, getExpressionType, getFeatureType, getFunctionName, getFunctionReturnType, getParameter, getPrimaryKey, getSqlNameEscape, isBinaryExpression, isEscapeBackslash, isInEncodingEnabled, processLikeLeftOperand, 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, visit, visit, visitBinaryComparisonOperator, visitBinarySpatialOperator, visitBinarySpatialOperator, visitBinarySpatialOperator, visitBinaryTemporalOperator, visitBinaryTemporalOperator, visitBinaryTemporalOperator, visitInFunction, visitLiteralGeometry, visitLiteralTimePeriod, visitNullFilter, writeBinaryExpression, writeBinaryExpressionMember, writeLiteral
-
Field Details
-
literalValues
ordered list of literal values encountered and their types -
literalTypes
-
SRIDs
-
dimensions
-
descriptors
-
dialect
-
-
Constructor Details
-
PreparedFilterToSQL
Contructor taking a reference to the SQL dialect, will use it to encode geometry placeholders -
PreparedFilterToSQL
-
-
Method Details
-
isPrepareEnabled
public boolean isPrepareEnabled()If true (default) a sql statement with literal placemarks is created, otherwise a normal statement is created -
setPrepareEnabled
public void setPrepareEnabled(boolean prepareEnabled) -
visit
Description copied from class:FilterToSQL
Export the contents of a Literal Expresion- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classFilterToSQL
- Parameters:
expression
- the Literal to export- Throws:
RuntimeException
- for io exception with writer
-
convertEnvelopeToPolygon
protected boolean convertEnvelopeToPolygon() -
visit
Encodes an Id filter- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classFilterToSQL
- Parameters:
filter
- the- Throws:
RuntimeException
- If there's a problem writing output
-
getLiteralValues
-
getLiteralTypes
-
getSRIDs
Returns the list of native SRID for each literal that happens to be a geometry, or null otherwise -
getDimensions
Returns the list of dimensions for each literal tha happens to be a geometry, or null otherwise -
getDescriptors
Returns the attribute descriptors compared to a given literal (if any, not always available, normally only needed if arrays are involved)
-