public class PreparedFilterToSQL extends FilterToSQL
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()
.
FilterToSQL.FieldEncoder
Modifier and Type | Field and Description |
---|---|
protected List<AttributeDescriptor> |
descriptors |
protected PreparedStatementSQLDialect |
dialect |
protected List<Integer> |
dimensions |
protected List<Class> |
literalTypes |
protected List<Object> |
literalValues
ordered list of literal values encountered and their types
|
protected List<Integer> |
SRIDs |
capabilities, currentDimension, currentGeometry, currentSRID, databaseSchema, encodingFunction, featureType, fieldEncoder, filterFactory, inEncodingEnabled, inline, IO_ERROR, LOGGER, out, primaryKey, sqlNameEscape
Constructor and Description |
---|
PreparedFilterToSQL(PreparedStatementSQLDialect dialect)
Contructor taking a reference to the SQL dialect, will use it to encode geometry placeholders
|
PreparedFilterToSQL(Writer out) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
convertEnvelopeToPolygon()
|
List<AttributeDescriptor> |
getDescriptors()
Returns the attribute descriptors compared to a given literal (if any, not always available,
normally only needed if arrays are involved)
|
List<Integer> |
getDimensions()
Returns the list of dimensions for each literal tha happens to be a geometry, or null
otherwise
|
List<Class> |
getLiteralTypes() |
List<Object> |
getLiteralValues() |
List<Integer> |
getSRIDs()
Returns the list of native SRID for each literal that happens to be a geometry, or null
otherwise
|
boolean |
isPrepareEnabled()
If true (default) a sql statement with literal placemarks is created, otherwise a normal
statement is created
|
void |
setPrepareEnabled(boolean prepareEnabled) |
Object |
visit(Id filter,
Object extraData)
Encodes an Id filter
|
Object |
visit(Literal expression,
Object context)
Export the contents of a Literal Expresion
|
cast, createFilterCapabilities, 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, visit, visit, visit, visitBinaryComparisonOperator, visitBinarySpatialOperator, visitBinarySpatialOperator, visitBinarySpatialOperator, visitBinaryTemporalOperator, visitBinaryTemporalOperator, visitBinaryTemporalOperator, visitInFunction, visitLiteralGeometry, visitLiteralTimePeriod, visitNullFilter, writeBinaryExpression, writeBinaryExpressionMember, writeLiteral
protected List<Object> literalValues
protected List<AttributeDescriptor> descriptors
protected PreparedStatementSQLDialect dialect
public PreparedFilterToSQL(PreparedStatementSQLDialect dialect)
public PreparedFilterToSQL(Writer out)
public boolean isPrepareEnabled()
public void setPrepareEnabled(boolean prepareEnabled)
public Object visit(Literal expression, Object context) throws RuntimeException
FilterToSQL
visit
in interface ExpressionVisitor
visit
in class FilterToSQL
expression
- the Literal to exportRuntimeException
- for io exception with writerprotected boolean convertEnvelopeToPolygon()
public Object visit(Id filter, Object extraData)
visit
in interface FilterVisitor
visit
in class FilterToSQL
filter
- theRuntimeException
- If there's a problem writing outputpublic List<Integer> getSRIDs()
public List<Integer> getDimensions()
public List<AttributeDescriptor> getDescriptors()
Copyright © 1996–2022 Geotools. All rights reserved.