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, mapper, out, primaryKey
Constructor and Description |
---|
PreparedFilterToSQL()
Deprecated.
Use
PreparedFilterToSQL(PreparedStatementSQLDialect) instead |
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 |
---|---|
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, encodeToString, encodeToString, escapeName, evaluateLiteral, getCapabilities, getDatabaseSchema, getDistanceInMeters, getDistanceInNativeUnits, getExpressionType, getFeatureType, getFIDMapper, getFunctionName, getFunctionReturnType, getParameter, getPrimaryKey, getReferenceGeometryCentroid, isBinaryExpression, isInEncodingEnabled, setCapabilities, setDatabaseSchema, setFeatureType, setFIDMapper, 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()
PreparedFilterToSQL(PreparedStatementSQLDialect)
insteadpublic PreparedFilterToSQL(PreparedStatementSQLDialect dialect)
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 writerpublic 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–2019 Geotools. All rights reserved.