|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectFilterToSQL
PreparedFilterToSQL
public class PreparedFilterToSQL
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()
.
modules/library/jdbc (gt-jdbc.jar)
Field Summary | |
---|---|
protected Integer |
currentSRID
|
protected PreparedStatementSQLDialect |
dialect
|
protected List<Class> |
literalTypes
|
protected List<Object> |
literalValues
ordered list of literal values encountered and their types |
protected List<Integer> |
SRIDs
|
Fields inherited from class FilterToSQL |
---|
capabilities, encodingFunction, featureType, IO_ERROR, mapper, out |
Constructor Summary | |
---|---|
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)
|
Method Summary | |
---|---|
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 |
protected Object |
visitBinarySpatialOperator(BinarySpatialOperator filter,
Object extraData)
|
protected Object |
visitBinarySpatialOperator(BinarySpatialOperator filter,
PropertyName property,
Literal geometry,
boolean swapped,
Object extraData)
Subclasses should override this, the property and the geometry have already been separated out |
Methods inherited from class FilterToSQL |
---|
createFilterCapabilities, encode, encode, encodeToString, encodeToString, escapeName, evaluateLiteral, getCapabilities, getFIDMapper, setCapabilities, setFeatureType, setFIDMapper, 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, visitBinaryComparisonOperator, visitLiteralGeometry, visitNullFilter, writeLiteral |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Integer currentSRID
protected List<Object> literalValues
protected List<Class> literalTypes
protected List<Integer> SRIDs
protected PreparedStatementSQLDialect dialect
Constructor Detail |
---|
public PreparedFilterToSQL()
PreparedFilterToSQL(PreparedStatementSQLDialect)
instead
public PreparedFilterToSQL(PreparedStatementSQLDialect dialect)
dialect
- public PreparedFilterToSQL(Writer out)
Method Detail |
---|
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 export
RuntimeException
- for io exception with writerpublic Object visit(Id filter, Object extraData)
visit
in interface FilterVisitor
visit
in class FilterToSQL
filter
- the
RuntimeException
- If there's a problem writing outputpublic List<Object> getLiteralValues()
public List<Class> getLiteralTypes()
public List<Integer> getSRIDs()
protected Object visitBinarySpatialOperator(BinarySpatialOperator filter, Object extraData)
visitBinarySpatialOperator
in class FilterToSQL
FilterVisitor#visit()}
protected Object visitBinarySpatialOperator(BinarySpatialOperator filter, PropertyName property, Literal geometry, boolean swapped, Object extraData)
filter
- the original filter to be encodedproperty
- the property namegeometry
- the geometry nameswapped
- if true, the operation is literal op name
, if false it's the normal
name op literal
extraData
- the context
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |