public abstract class BasicSQLDialect extends SQLDialect
BASE_DBMS_CAPABILITIES, dataStore, LOGGER
Modifier | Constructor and Description |
---|---|
protected |
BasicSQLDialect(JDBCDataStore dataStore) |
Modifier and Type | Method and Description |
---|---|
FilterToSQL |
createFilterToSQL()
Creates the filter encoder to be used by the datastore when encoding query predicates.
|
abstract void |
encodeGeometryValue(Geometry value,
int dimension,
int srid,
StringBuffer sql)
Encodes a geometry value in an sql statement.
|
void |
encodeValue(Object value,
Class type,
StringBuffer sql)
Encodes a value in an sql statement.
|
void |
onDelete(Statement delete,
Connection cx,
SimpleFeatureType featureType)
Callback invoked before a DELETE statement is executed against the database.
|
void |
onInsert(Statement insert,
Connection cx,
SimpleFeatureType featureType)
Callback invoked before an INSERT statement is executed against the database.
|
void |
onSelect(Statement select,
Connection cx,
SimpleFeatureType featureType)
Callback invoked before a SELECT statement is executed against the database.
|
void |
onUpdate(Statement update,
Connection cx,
SimpleFeatureType featureType)
Callback invoked before an UPDATE statement is executed against the database.
|
addSupportedHints, applyLimitOffset, createCRS, createIndex, decodeGeometryEnvelope, decodeGeometryValue, decodeGeometryValue, dropIndex, encodeAggregateFunction, encodeAggregateFunctionPostfix, encodeAggregateFunctionPrefix, encodeColumnAlias, encodeColumnName, encodeColumnName, encodeColumnType, encodeCreateTable, encodeGeometryColumn, encodeGeometryColumn, encodeGeometryColumn, encodeGeometryColumnGeneralized, encodeGeometryColumnGeneralized, encodeGeometryColumnSimplified, encodeGeometryColumnSimplified, encodeGeometryEnvelope, encodeJoin, encodeNextSequenceValue, encodePostColumnCreateTable, encodePostCreateTable, encodePostSelect, encodePrimaryKey, encodeSchemaName, encodeTableAlias, encodeTableName, getDefaultVarcharSize, getDesiredTablesType, getGeometryDimension, getGeometrySRID, getGeometryTypeName, getIndexes, getLastAutoGeneratedValue, getLastAutoGeneratedValue, getMapping, getNameEscape, getNextAutoGeneratedValue, getNextSequenceValue, getOptimizedBounds, getPkColumnValue, getPrimaryKey, getSequenceForColumn, handleSelectHints, handleUserDefinedType, includeTable, initializeConnection, isAggregatedSortSupported, isAutoCommitQuery, isGroupBySupported, isLimitOffsetSupported, lookupGeneratedValuesPostInsert, ne, postCreateAttribute, postCreateFeatureType, postCreateTable, postDropTable, preDropTable, registerAggregateFunctions, registerClassToSqlMappings, registerFunctions, registerSqlTypeNameToClassMappings, registerSqlTypeToClassMappings, registerSqlTypeToSqlTypeNameOverrides, splitFilter, supportsSchemaForIndex
protected BasicSQLDialect(JDBCDataStore dataStore)
public void encodeValue(Object value, Class type, StringBuffer sql)
Subclasses may wish to override or extend this method to handle specific types. This default implementation does the following:
Object.toString()
representation.
CharSequence
), it is wrapped in
single quotes (').
public abstract void encodeGeometryValue(Geometry value, int dimension, int srid, StringBuffer sql) throws IOException
An implementations should serialize value into some exchange format which will then be transported to the underlying database. For example, consider an implementation which converts a geometry into its well known text representation:
sql.append( "GeomFromText('" );
sql.append( new WKTWriter().write( value ) );
sql.append( ")" );
The srid parameter is the spatial reference system identifier of the geometry, or 0 if not known.
Attention should be paid to emtpy geometries (g.isEmtpy() == true
) as they
cannot be encoded in WKB and several databases fail to handle them property. Common treatment
is to equate them to NULL
IOException
public FilterToSQL createFilterToSQL()
Sublcasses can override this method to return a subclass of FilterToSQL
if need
be.
public void onSelect(Statement select, Connection cx, SimpleFeatureType featureType) throws SQLException
The callback is provided with both the statement being executed and the database connection. Neither should be closed. Any statements created from the connection however in this method should be closed.
select
- The select statement being executedcx
- The database connectionfeatureType
- The feature type the select is executing against.SQLException
public void onDelete(Statement delete, Connection cx, SimpleFeatureType featureType) throws SQLException
The callback is provided with both the statement being executed and the database connection. Neither should be closed. Any statements created from the connection however in this method should be closed.
delete
- The delete statement being executedcx
- The database connectionfeatureType
- The feature type the delete is executing against.SQLException
public void onInsert(Statement insert, Connection cx, SimpleFeatureType featureType) throws SQLException
The callback is provided with both the statement being executed and the database connection. Neither should be closed. Any statements created from the connection however in this method should be closed.
insert
- The delete statement being executedcx
- The database connectionfeatureType
- The feature type the insert is executing against.SQLException
public void onUpdate(Statement update, Connection cx, SimpleFeatureType featureType) throws SQLException
The callback is provided with both the statement being executed and the database connection. Neither should be closed. Any statements created from the connection however in this method should be closed.
update
- The delete statement being executedcx
- The database connectionfeatureType
- The feature type the update is executing against.SQLException
Copyright © 1996–2019 Geotools. All rights reserved.