org.jpox.store.rdbms.adapter
Class PostGISAdapter

java.lang.Object
  extended by org.jpox.store.mapped.AbstractDatastoreAdapter
      extended by org.jpox.store.rdbms.adapter.DatabaseAdapter
          extended by org.jpox.store.rdbms.adapter.PostgreSQLAdapter
              extended by org.jpox.store.rdbms.adapter.PostGISAdapter
All Implemented Interfaces:
org.jpox.store.mapped.DatastoreAdapter, org.jpox.store.mapped.expression.ExpressionConversionAdapter, org.jpox.store.mapped.expression.ExpressionLogicSetAdapter, org.jpox.store.mapped.expression.ExpressionMethodAdapter, org.jpox.store.mapped.expression.ExpressionOperatorAdapter, org.jpox.store.mapped.expression.ExpressionPatternAdapter, org.jpox.store.mapped.expression.ExpressionSupportedFeaturesAdapter, org.jpox.store.rdbms.adapter.RDBMSAdapter, SpatialRDBMSAdapter

public class PostGISAdapter
extends org.jpox.store.rdbms.adapter.PostgreSQLAdapter
implements SpatialRDBMSAdapter

Provides methods for adapting SQL language elements for the PostGIS extension.

Version:
$Revision: 1.1 $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jpox.store.rdbms.adapter.DatabaseAdapter
org.jpox.store.rdbms.adapter.DatabaseAdapter.JDBCTypeInfo
 
Field Summary
static java.lang.String HAS_MEASURE_EXTENSION_KEY
          Key name for the hasMeasure extension.
protected static org.jpox.util.Localiser LOCALISER_POSTGIS
           
 
Fields inherited from class org.jpox.store.rdbms.adapter.PostgreSQLAdapter
POSTGRESQL_RESERVED_WORDS, psqlTypes
 
Fields inherited from class org.jpox.store.rdbms.adapter.DatabaseAdapter
catalogSeparator, driverMajorVersion, driverMinorVersion, driverName, driverVersion, LOCALISER, maxColumnNameLength, maxConstraintNameLength, maxIndexNameLength, maxTableNameLength, storesLowerCaseIdentifiers, storesLowerCaseQuotedIdentifiers, storesMixedCaseIdentifiers, storesMixedCaseQuotedIdentifiers, storesMixedCaseQuotedSensitiveIdentifiers, storesMixedCaseSensitiveIdentifiers, storesUpperCaseIdentifiers, storesUpperCaseQuotedIdentifiers, supportsCatalogsInTableDefinitions, supportsSchemasInTableDefinitions, supportsStatementBatching, typesByTypeNumber
 
Fields inherited from class org.jpox.store.mapped.AbstractDatastoreAdapter
datastoreMajorVersion, datastoreMinorVersion, datastoreProductName, datastoreProductVersion, datastoreRevisionVersion, identifierQuoteString, LOCALISER_BASE, mappingManager, reservedKeywords
 
Fields inherited from interface org.jpox.store.rdbms.adapter.SpatialRDBMSAdapter
DIMENSION_EXTENSION_KEY, SRID_EXTENSION_KEY
 
Constructor Summary
PostGISAdapter(java.sql.DatabaseMetaData metadata)
           
 
Method Summary
 java.lang.String getAddColumnStatement(org.jpox.store.mapped.DatastoreContainerObject table, org.jpox.store.rdbms.Column column)
           
 java.lang.String getAddPrimaryKeyStatement(org.jpox.store.rdbms.key.PrimaryKey pk, org.jpox.store.mapped.IdentifierFactory factory)
           
 java.lang.String getCalculateBoundsStatement(org.jpox.store.rdbms.table.Table table, org.jpox.store.rdbms.Column column)
          Returns the appropriate SQL statement that calculates the bounds of all geometries in the given column.
 java.lang.String getCreateTableStatement(org.jpox.store.rdbms.table.TableImpl table, org.jpox.store.rdbms.Column[] columns, java.util.Properties props)
           
 java.lang.String getRetrieveCrsNameStatement(org.jpox.store.rdbms.table.Table table, int srid)
          Returns the appropriate SQL statement to retrieve the name of the Coordinate Reference System (CRS) with the given srid.
 java.lang.String getRetrieveCrsWktStatement(org.jpox.store.rdbms.table.Table table, int srid)
          Returns the appropriate SQL statement to retrieve description of the Coordinate Reference System (CRS) with the given srid.
 boolean isGeometryColumn(org.jpox.store.rdbms.Column column)
          Checks whether the given column is geometry backed by the datastore.
 boolean supportsPrimaryKeyInCreateStatements()
           
 
Methods inherited from class org.jpox.store.rdbms.adapter.PostgreSQLAdapter
getAutoIncrementKeyword, getAutoIncrementStmt, getCharColumnsPaddedWithSpaces, getDayMethod, getDropTableStatement, getEscapePatternExpression, getHourMethod, getInsertStatementForNoColumns, getMinuteMethod, getMonthMethod, getRangeByLimitWhereClause, getSecondMethod, getSequenceCreateStmt, getSequenceNextStmt, getSupportsPersistOfUnassignedChar, getVendorID, getYearMethod, indexOfMethod, isBitReallyBoolean, newColumnInfo, newForeignKeyInfo, newTableExpression, newTypeInfo, supportsAlterTableDropConstraint, supportsAnalysisMethods, supportsAutoIncrementColumnTypeSpecification, supportsAutoIncrementKeysNullSpecification, supportsDistinctWithSelectForUpdate, supportsIdentityFields, supportsLockWithSelectForUpdate, supportsQueryFetchSize, supportsSequences, supportsTransactionIsolationLevel
 
Methods inherited from class org.jpox.store.rdbms.adapter.DatabaseAdapter
absMethod, acosMethod, addTypeInfo, asinMethod, atanMethod, cartersianProduct, ceilMethod, closeConnection, concatOperator, cosMethod, createIndexesBeforeForeignKeys, endsWithMethod, expMethod, floorMethod, getAddCandidateKeyStatement, getAddForeignKeyStatement, getCatalogName, getCatalogSeparator, getCheckConstraintForValues, getColumns, getColumns, getConnection, getContinuationString, getCreateIndexStatement, getCurrentDateMethod, getCurrentTimeMethod, getCurrentTimestampMethod, getDatastoreDateStatement, getDriverMajorVersion, getDriverMinorVersion, getDropViewStatement, getEscapeCharacter, getEscapedPatternExpression, getExistingIndexes, getMaxColumnNameLength, getMaxConstraintNameLength, getMaxForeignKeys, getMaxIndexes, getMaxIndexNameLength, getMaxTableNameLength, getNewMappingManager, getNewUUIDFunction, getNonAnsiInnerJoinWhereClause, getNonAnsiLeftOuterJoinWhereClause, getNonAnsiRightOuterJoinWhereClause, getOperatorConcat, getPatternExpressionAnyCharacter, getPatternExpressionZeroMoreCharacters, getPlaceWithOptionAfterFromClause, getPlaceWithOptionWithinJoinClauses, getRangeByLimitSelectClause, getRangeByRowNumberColumn, getRequiredTransactionIsolationLevel, getSchemaName, getSelectNewUUIDStmt, getSelectWithLockOption, getSurrogateForEmptyStrings, getTables, getTransactionIsolationForSchemaCreation, getTypeInfo, getUnlimitedLengthPrecisionValue, includeOrderByColumnsInSelect, initialiseDatastore, isIdentityFieldDataType, isNullEqualsEmptyStrings, isSQLKeyword, isStoresLowerCaseIdentifiers, isStoresLowerCaseQuotedIdentifiers, isStoresMixedCaseIdentifiers, isStoresMixedCaseQuotedIdentifiers, isStoresUpperCaseIdentifiers, isStoresUpperCaseQuotedIdentifiers, isValidPrimaryKeyType, iteratorReservedWords, iteratorTypeInfo, lengthMethod, loadDatastoreMapping, logConfiguration, logMethod, matchesMethod, newExportedKeyInfo, newQueryStatement, newQueryStatement, parseKeywordList, requiresColumnDefaultsInitialising, setDefaultTypeInfoForJDBCType, sinMethod, sqrtMethod, startsWithMethod, substringMethod, substringMethod, supportsAlterTableDropForeignKeyConstraint, supportsAnsiJoinSyntax, supportsBooleanComparison, supportsCatalogsInTableDefinitions, supportsCheckConstraintsInEndCreateStatements, supportsCheckInCreateStatements, supportsDefaultBeforeNullInColumnOptions, supportsDefaultKeywordInColumnOptions, supportsDefaultKeywordWithNotNullInColumnOptions, supportsDeferredConstraints, supportsEscapeExpressionInLikePredicate, supportsExistsSyntax, supportsForeignKeyDeleteAction, supportsForeignKeyUpdateAction, supportsNullsInCandidateKeys, supportsNullsKeywordInColumnOptions, supportsProjectionInTableReferenceJoins, supportsSchemasInTableDefinitions, supportsSettingBlobUsingSetString, supportsSettingClobUsingSetString, supportsStatementBatching, supportsStatementGetGeneratedKeys, supportsUnionSyntax, supportsUniqueConstraintsInEndCreateStatements, tanMethod, toNumericExpression, toString, toStringExpression, toStringExpression, translateMethod, trimMethod, useUnionAll
 
Methods inherited from class org.jpox.store.mapped.AbstractDatastoreAdapter
getAdapterTime, getDatastoreMajorVersion, getDatastoreMinorVersion, getIdentifierQuoteString, getMapping, getMapping, getMapping, getMapping, getMapping, getMappingManager, getMiliseconds, getTime, isReservedKeyword, modOperator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jpox.store.rdbms.adapter.RDBMSAdapter
closeConnection, createIndexesBeforeForeignKeys, getAddCandidateKeyStatement, getAddForeignKeyStatement, getAutoIncrementKeyword, getAutoIncrementStmt, getCatalogName, getCatalogSeparator, getCharColumnsPaddedWithSpaces, getCheckConstraintForValues, getColumns, getColumns, getConnection, getCreateIndexStatement, getDatastoreDateStatement, getDropTableStatement, getDropViewStatement, getExistingIndexes, getIdentifierQuoteString, getInsertStatementForNoColumns, getMaxColumnNameLength, getMaxConstraintNameLength, getMaxForeignKeys, getMaxIndexes, getMaxIndexNameLength, getMaxTableNameLength, getNonAnsiInnerJoinWhereClause, getNonAnsiLeftOuterJoinWhereClause, getPlaceWithOptionAfterFromClause, getPlaceWithOptionWithinJoinClauses, getRangeByLimitSelectClause, getRangeByLimitWhereClause, getRangeByRowNumberColumn, getRequiredTransactionIsolationLevel, getSchemaName, getSelectNewUUIDStmt, getSelectWithLockOption, getSequenceCreateStmt, getSequenceNextStmt, getSupportsPersistOfUnassignedChar, getSurrogateForEmptyStrings, getTables, getTransactionIsolationForSchemaCreation, getTypeInfo, getUnlimitedLengthPrecisionValue, includeOrderByColumnsInSelect, isNullEqualsEmptyStrings, isSQLKeyword, isValidPrimaryKeyType, iteratorReservedWords, iteratorTypeInfo, logConfiguration, newColumnInfo, newForeignKeyInfo, newTableExpression, requiresColumnDefaultsInitialising, supportsAlterTableDropConstraint, supportsAlterTableDropForeignKeyConstraint, supportsAnalysisMethods, supportsAnsiJoinSyntax, supportsAutoIncrementColumnTypeSpecification, supportsAutoIncrementKeysNullSpecification, supportsCatalogsInTableDefinitions, supportsCheckInCreateStatements, supportsDefaultBeforeNullInColumnOptions, supportsDefaultKeywordInColumnOptions, supportsDefaultKeywordWithNotNullInColumnOptions, supportsDeferredConstraints, supportsDistinctWithSelectForUpdate, supportsExistsSyntax, supportsForeignKeyDeleteAction, supportsForeignKeyUpdateAction, supportsLockWithSelectForUpdate, supportsNullsInCandidateKeys, supportsNullsKeywordInColumnOptions, supportsSchemasInTableDefinitions, supportsSequences, supportsSettingBlobUsingSetString, supportsSettingClobUsingSetString, supportsStatementBatching, supportsStatementGetGeneratedKeys, supportsTransactionIsolationLevel, supportsUnionSyntax, supportsUniqueConstraintsInEndCreateStatements, useUnionAll
 
Methods inherited from interface org.jpox.store.mapped.DatastoreAdapter
getAdapterTime, getDatastoreMajorVersion, getDatastoreMinorVersion, getMapping, getMapping, getMapping, getMapping, getMappingManager, getVendorID, initialiseDatastore, isBitReallyBoolean, isIdentityFieldDataType, isReservedKeyword, isStoresLowerCaseIdentifiers, isStoresLowerCaseQuotedIdentifiers, isStoresMixedCaseIdentifiers, isStoresMixedCaseQuotedIdentifiers, isStoresUpperCaseIdentifiers, isStoresUpperCaseQuotedIdentifiers, loadDatastoreMapping, modOperator, newQueryStatement, newQueryStatement, supportsIdentityFields, supportsProjectionInTableReferenceJoins, supportsQueryFetchSize, toString
 
Methods inherited from interface org.jpox.store.mapped.expression.ExpressionConversionAdapter
toNumericExpression, toStringExpression, toStringExpression
 
Methods inherited from interface org.jpox.store.mapped.expression.ExpressionOperatorAdapter
concatOperator, getOperatorConcat
 
Methods inherited from interface org.jpox.store.mapped.expression.ExpressionMethodAdapter
absMethod, acosMethod, asinMethod, atanMethod, ceilMethod, cosMethod, endsWithMethod, expMethod, floorMethod, getCurrentDateMethod, getCurrentTimeMethod, getCurrentTimestampMethod, getDayMethod, getHourMethod, getMinuteMethod, getMonthMethod, getSecondMethod, getYearMethod, indexOfMethod, lengthMethod, logMethod, matchesMethod, sinMethod, sqrtMethod, startsWithMethod, substringMethod, substringMethod, tanMethod, translateMethod, trimMethod
 
Methods inherited from interface org.jpox.store.mapped.expression.ExpressionSupportedFeaturesAdapter
supportsBooleanComparison, supportsEscapeExpressionInLikePredicate
 
Methods inherited from interface org.jpox.store.mapped.expression.ExpressionPatternAdapter
getEscapeCharacter, getEscapedPatternExpression, getEscapePatternExpression, getPatternExpressionAnyCharacter, getPatternExpressionZeroMoreCharacters
 
Methods inherited from interface org.jpox.store.mapped.expression.ExpressionLogicSetAdapter
cartersianProduct
 

Field Detail

LOCALISER_POSTGIS

protected static final org.jpox.util.Localiser LOCALISER_POSTGIS

HAS_MEASURE_EXTENSION_KEY

public static final java.lang.String HAS_MEASURE_EXTENSION_KEY
Key name for the hasMeasure extension.

See Also:
Constant Field Values
Constructor Detail

PostGISAdapter

public PostGISAdapter(java.sql.DatabaseMetaData metadata)
Method Detail

supportsPrimaryKeyInCreateStatements

public boolean supportsPrimaryKeyInCreateStatements()
Specified by:
supportsPrimaryKeyInCreateStatements in interface org.jpox.store.rdbms.adapter.RDBMSAdapter
Overrides:
supportsPrimaryKeyInCreateStatements in class org.jpox.store.rdbms.adapter.PostgreSQLAdapter

getAddPrimaryKeyStatement

public java.lang.String getAddPrimaryKeyStatement(org.jpox.store.rdbms.key.PrimaryKey pk,
                                                  org.jpox.store.mapped.IdentifierFactory factory)
Specified by:
getAddPrimaryKeyStatement in interface org.jpox.store.rdbms.adapter.RDBMSAdapter
Overrides:
getAddPrimaryKeyStatement in class org.jpox.store.rdbms.adapter.PostgreSQLAdapter

getAddColumnStatement

public java.lang.String getAddColumnStatement(org.jpox.store.mapped.DatastoreContainerObject table,
                                              org.jpox.store.rdbms.Column column)
Specified by:
getAddColumnStatement in interface org.jpox.store.rdbms.adapter.RDBMSAdapter
Overrides:
getAddColumnStatement in class org.jpox.store.rdbms.adapter.PostgreSQLAdapter

getCreateTableStatement

public java.lang.String getCreateTableStatement(org.jpox.store.rdbms.table.TableImpl table,
                                                org.jpox.store.rdbms.Column[] columns,
                                                java.util.Properties props)
Specified by:
getCreateTableStatement in interface org.jpox.store.rdbms.adapter.RDBMSAdapter
Overrides:
getCreateTableStatement in class org.jpox.store.rdbms.adapter.DatabaseAdapter

getRetrieveCrsWktStatement

public java.lang.String getRetrieveCrsWktStatement(org.jpox.store.rdbms.table.Table table,
                                                   int srid)
Description copied from interface: SpatialRDBMSAdapter
Returns the appropriate SQL statement to retrieve description of the Coordinate Reference System (CRS) with the given srid.

Specified by:
getRetrieveCrsWktStatement in interface SpatialRDBMSAdapter
Parameters:
table - A table
srid - The srid
Returns:
SQL statement, null if not available for the datastore

getRetrieveCrsNameStatement

public java.lang.String getRetrieveCrsNameStatement(org.jpox.store.rdbms.table.Table table,
                                                    int srid)
Description copied from interface: SpatialRDBMSAdapter
Returns the appropriate SQL statement to retrieve the name of the Coordinate Reference System (CRS) with the given srid.

Specified by:
getRetrieveCrsNameStatement in interface SpatialRDBMSAdapter
Parameters:
table - A table
srid - The srid
Returns:
SQL statement, null if not available for the datastore

getCalculateBoundsStatement

public java.lang.String getCalculateBoundsStatement(org.jpox.store.rdbms.table.Table table,
                                                    org.jpox.store.rdbms.Column column)
Description copied from interface: SpatialRDBMSAdapter
Returns the appropriate SQL statement that calculates the bounds of all geometries in the given column.

Specified by:
getCalculateBoundsStatement in interface SpatialRDBMSAdapter
Parameters:
table - The table
column - The column
Returns:
SQL statement, null if not available for the datastore

isGeometryColumn

public boolean isGeometryColumn(org.jpox.store.rdbms.Column column)
Description copied from interface: SpatialRDBMSAdapter
Checks whether the given column is geometry backed by the datastore.

Specified by:
isGeometryColumn in interface SpatialRDBMSAdapter
Parameters:
column - Column to check
Returns:
true if the given column is geometry backed, false otherwise


Copyright © -2008 . All Rights Reserved.