org.geotools.jdbc
Class BasicSQLDialect

Object
  extended by SQLDialect
      extended by BasicSQLDialect
Direct Known Subclasses:
DB2SQLDialectBasic, H2DialectBasic, MySQLDialectBasic, PostGISDialect, SpatiaLiteDialect, SQLServerDialect

public abstract class BasicSQLDialect
extends SQLDialect


Field Summary
 
Fields inherited from class SQLDialect
BASE_DBMS_CAPABILITIES, dataStore, LOGGER
 
Constructor Summary
protected BasicSQLDialect(JDBCDataStore dataStore)
           
 
Method Summary
 FilterToSQL createFilterToSQL()
          Creates the filter encoder to be used by the datastore when encoding query predicates.
abstract  void encodeGeometryValue(Geometry value, 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.
 
Methods inherited from class SQLDialect
addSupportedHints, applyLimitOffset, createCRS, decodeGeometryEnvelope, decodeGeometryValue, decodeGeometryValue, encodeColumnAlias, encodeColumnName, encodeColumnType, encodeGeometryColumn, encodeGeometryColumnGeneralized, encodeGeometryColumnSimplified, encodeGeometryEnvelope, encodePostColumnCreateTable, encodePostCreateTable, encodePrimaryKey, encodeSchemaName, encodeTableAlias, encodeTableName, getGeometrySRID, getGeometryTypeName, getLastAutoGeneratedValue, getMapping, getNameEscape, getNextAutoGeneratedValue, getNextSequenceValue, getSequenceForColumn, includeTable, initializeConnection, isLimitOffsetSupported, lookupGeneratedValuesPostInsert, ne, postCreateAttribute, postCreateFeatureType, postCreateTable, registerAggregateFunctions, registerClassToSqlMappings, registerSqlTypeNameToClassMappings, registerSqlTypeToClassMappings, registerSqlTypeToSqlTypeNameOverrides
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicSQLDialect

protected BasicSQLDialect(JDBCDataStore dataStore)
Method Detail

encodeValue

public void encodeValue(Object value,
                        Class type,
                        StringBuffer sql)
Encodes a value in an sql statement.

Subclasses may wish to override or extend this method to handle specific types. This default implementation does the following:

  1. The value is encoded via its Object.toString() representation.
  2. If type is a character type (extends CharSequence), it is wrapped in single quotes (').


encodeGeometryValue

public abstract void encodeGeometryValue(Geometry value,
                                         int srid,
                                         StringBuffer sql)
                                  throws IOException
Encodes a geometry value in an sql statement.

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.

Throws:
IOException

createFilterToSQL

public FilterToSQL createFilterToSQL()
Creates the filter encoder to be used by the datastore when encoding query predicates.

Sublcasses can override this method to return a subclass of FilterToSQL if need be.



Copyright © 1996-2010 Geotools. All Rights Reserved.