org.deegree.sqldialect
Interface SQLDialect

All Known Implementing Classes:
OracleDialect, PostGISDialect

public interface SQLDialect

Implementations provide the vendor-specific behavior for a spatial DBMS so it can be accessed by deegree.

Version:
$Revision: 31186 $, $Date: 2011-07-01 18:01:58 +0200 (Fr, 01. Jul 2011) $
Author:
Andreas Schmitz, Markus Schneider, last edited by: $Author: mschneider $

Method Summary
 String cast(String expr, String type)
           
 void createAutoColumn(StringBuffer currentStmt, List<StringBuffer> additionalSmts, String column, String table)
           
 void createDB(Connection adminConn, String dbName)
          Creates a new (spatially-enabled) database using the specified administrator connection.
 void dropDB(Connection adminConn, String dbName)
          Drops the specified database.
 String geometryMetadata(QTableName qTable, String column, boolean isGeographical)
           
 String getBBoxAggregateSnippet(String colummn)
          Returns an SQL snippet for SELECTing the aggregate bounding box of the given column.
 Envelope getBBoxAggregateValue(ResultSet rs, int colIdx, ICRS crs)
          Converts the value that has been SELECTed via getBBoxAggregateSnippet(String) into an Envelope.
 ConnectionManager.Type getDBType()
          Returns the ConnectionManager.Type of JDBC connection that this dialect can handle.
 String getDefaultSchema()
           
 GeometryParticleConverter getGeometryConverter(String column, ICRS crs, String srid, boolean is2d)
           
 int getMaxColumnNameLength()
          Returns the maximum number of characters allowed for column names.
 int getMaxTableNameLength()
          Returns the maximum number of characters allowed for table names.
 PrimitiveParticleConverter getPrimitiveConverter(String column, PrimitiveType pt)
           
 ResultSet getTableColumnMetadata(DatabaseMetaData md, QTableName table)
           
 String getUndefinedSrid()
          Returns the SRID code for undefined.
 AbstractWhereBuilder getWhereBuilder(PropertyNameMapper mapper, OperatorFilter filter, SortProperty[] sortCrit, boolean allowPartialMappings)
          Returns an AbstractWhereBuilder instance for the given parameters.
 boolean requiresTransactionForCursorMode()
          Returns whether a transaction context is required for cursor mode to work.
 String stringIndex(String pattern, String string)
           
 String stringPlus()
           
 

Method Detail

getDBType

ConnectionManager.Type getDBType()
Returns the ConnectionManager.Type of JDBC connection that this dialect can handle.

Returns:
the db type, never null

getMaxColumnNameLength

int getMaxColumnNameLength()
Returns the maximum number of characters allowed for column names.

Returns:
maximum number of characters

getMaxTableNameLength

int getMaxTableNameLength()
Returns the maximum number of characters allowed for table names.

Returns:
maximum number of characters

getDefaultSchema

String getDefaultSchema()
Returns:
the default table schema to use for the database (eg. for requesting table metadata)

stringPlus

String stringPlus()
Returns:
the string concatenation operator

stringIndex

String stringIndex(String pattern,
                   String string)
Parameters:
pattern -
string -
Returns:
an expression that yields the string index

cast

String cast(String expr,
            String type)
Parameters:
expr -
type -
Returns:
expr cast to type

geometryMetadata

String geometryMetadata(QTableName qTable,
                        String column,
                        boolean isGeographical)
Parameters:
qTable -
column -
isGeographical -
Returns:
statement to determine the coordinate dimension, the srid and the geometry type of a given column (in this order)

getWhereBuilder

AbstractWhereBuilder getWhereBuilder(PropertyNameMapper mapper,
                                     OperatorFilter filter,
                                     SortProperty[] sortCrit,
                                     boolean allowPartialMappings)
                                     throws UnmappableException,
                                            FilterEvaluationException
Returns an AbstractWhereBuilder instance for the given parameters.

Parameters:
mapper - provides property name mappings, must not be null
filter - filter to use for generating the WHERE clause, can be null
sortCrit - criteria to use generating the ORDER BY clause, can be null
allowPartialMappings - if false, any unmappable expression will cause an UnmappableException to be thrown
Returns:
where builder, never null
Throws:
UnmappableException - if allowPartialMappings is false and an expression could not be mapped to the db
FilterEvaluationException

getUndefinedSrid

String getUndefinedSrid()
Returns the SRID code for undefined.

Returns:
SRID code, can be null/code>

getBBoxAggregateSnippet

String getBBoxAggregateSnippet(String colummn)
Returns an SQL snippet for SELECTing the aggregate bounding box of the given column.

Parameters:
colummn - name of the column that stores the bounding box, never null
Returns:
SQL snippet, never null

getBBoxAggregateValue

Envelope getBBoxAggregateValue(ResultSet rs,
                               int colIdx,
                               ICRS crs)
                               throws SQLException
Converts the value that has been SELECTed via getBBoxAggregateSnippet(String) into an Envelope.

Parameters:
rs -
colIdx -
crs -
Returns:
aggregate envelope, can be null
Throws:
SQLException

getGeometryConverter

GeometryParticleConverter getGeometryConverter(String column,
                                               ICRS crs,
                                               String srid,
                                               boolean is2d)

getPrimitiveConverter

PrimitiveParticleConverter getPrimitiveConverter(String column,
                                                 PrimitiveType pt)

createDB

void createDB(Connection adminConn,
              String dbName)
              throws SQLException
Creates a new (spatially-enabled) database using the specified administrator connection.

Parameters:
adminConn - administrator JDBC connection, must not be null
dbName - name of the database to be created, must not be null
Throws:
SQLException

dropDB

void dropDB(Connection adminConn,
            String dbName)
            throws SQLException
Drops the specified database.

Parameters:
adminConn - administrator JDBC connection, must not be null
dbName - name of the database to be created, must not be null
Throws:
SQLException

createAutoColumn

void createAutoColumn(StringBuffer currentStmt,
                      List<StringBuffer> additionalSmts,
                      String column,
                      String table)

getTableColumnMetadata

ResultSet getTableColumnMetadata(DatabaseMetaData md,
                                 QTableName table)
                                 throws SQLException
Throws:
SQLException

requiresTransactionForCursorMode

boolean requiresTransactionForCursorMode()
Returns whether a transaction context is required for cursor mode to work.

Returns:
true, if a transaction context is required, false otherwise


Copyright © 2011. All Rights Reserved.