|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectGeoAPISQLBuilder
DB2SQLBuilder
public class DB2SQLBuilder
A DB2-specific subclass of DefaultSQLBuilder, which supports DB2 Spatial Extender geometry datatypes.
Field Summary |
---|
Fields inherited from class GeoAPISQLBuilder |
---|
accessor, encoder, ft |
Constructor Summary | |
---|---|
DB2SQLBuilder(FilterToSQL encoder,
String tableSchema,
SimpleFeatureType featureType,
FIDMapper mapper)
Creates a DB2SQLBuilder that will provide a table schema to qualify table names. |
Method Summary | |
---|---|
String |
buildSQLBoundsQuery(String typeName,
AttributeDescriptor geomAttr,
Filter filter)
Builds the SQL query to get the bounds (min-max coordinate values) of a geometry column for a given filter. |
protected boolean |
isTypeNumeric(int columnType)
Checks if column type is SQL numeric type |
String |
makeDeleteSql(SimpleFeature feature)
Generates the SQL delete statement |
protected String |
makeFIDWhere(SimpleFeature feature)
Build a DB2 WHERE clause based on the FID column values |
protected String |
makeInsertSql(List<AttributeDescriptor> attributes,
SimpleFeature feature)
Creates a sql insert statement. |
protected String |
makeUpdateSql(List<AttributeDescriptor> attributes,
SimpleFeature live,
SimpleFeature current)
Generates the SQL UPDATE statement |
void |
sqlFrom(StringBuffer sql,
String typeName)
Construct the FROM clause for a feature type. |
void |
sqlGeometryColumn(StringBuffer sql,
AttributeDescriptor geomAttribute)
Generates the select column specification for a DB2 geometry column. |
Methods inherited from class GeoAPISQLBuilder |
---|
buildSQLQuery, buildSQLQuery, encode, encode, getFidValidator, getPostQueryFilter, getPreQueryFilter, isForce2D, setHints, splitFilter, sqlColumns, sqlOrderBy, sqlOrderBy, sqlWhere |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DB2SQLBuilder(FilterToSQL encoder, String tableSchema, SimpleFeatureType featureType, FIDMapper mapper)
It would be better if the table schema was managed by FeatureTypeHandler or FeatureType.
encoder
- an SQLEncodertableSchema
- table schema to qualify table namesfeatureType
- the feature type to be used by this SQL builderMethod Detail |
---|
public void sqlGeometryColumn(StringBuffer sql, AttributeDescriptor geomAttribute)
Overrides sqlGeometryColumn in DefaultSQLBuilder
sqlGeometryColumn
in class GeoAPISQLBuilder
sql
- A StringBuffer that the column specification can be appended
to.geomAttribute
- An AttributeType for a geometry attributepublic void sqlFrom(StringBuffer sql, String typeName)
This method could be promoted to DefaultSQLBuilder if the table schema was propagated up.
Overrides sqlFrom in DefaultSQLBuilder
sqlFrom
in interface SQLBuilder
sqlFrom
in class GeoAPISQLBuilder
sql
- StringBuffer to be appended totypeName
- Name of the type (table)public String buildSQLBoundsQuery(String typeName, AttributeDescriptor geomAttr, Filter filter) throws SQLEncoderException
typeName
- the feature type name.geomAttr
- the geometry attribute.filter
- the filter expression.
SQLEncoderException
protected String makeInsertSql(List<AttributeDescriptor> attributes, SimpleFeature feature) throws IOException
attributes
- the attribute columns to be insertedfeature
- the feature to add.
IOException
protected String makeUpdateSql(List<AttributeDescriptor> attributes, SimpleFeature live, SimpleFeature current) throws IOException
attributes
- the attribute columns to be insertedfeature
-
IOException
UnsupportedOperationException
public String makeDeleteSql(SimpleFeature feature) throws IOException
feature
-
IOException
IOException
UnsupportedOperationException
protected String makeFIDWhere(SimpleFeature feature) throws IOException
feature
-
IOException
protected boolean isTypeNumeric(int columnType)
SQL
- columnType
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |