org.datanucleus.store.rdbms.adapter
Class MySQLSpatialAdapter

java.lang.Object
  extended by org.datanucleus.store.rdbms.adapter.DatabaseAdapter
      extended by org.datanucleus.store.rdbms.adapter.MySQLAdapter
          extended by org.datanucleus.store.rdbms.adapter.MySQLSpatialAdapter
All Implemented Interfaces:
org.datanucleus.store.mapped.DatastoreAdapter, org.datanucleus.store.mapped.expression.ExpressionConversionAdapter, org.datanucleus.store.mapped.expression.ExpressionLogicSetAdapter, org.datanucleus.store.mapped.expression.ExpressionMethodAdapter, org.datanucleus.store.mapped.expression.ExpressionOperatorAdapter, org.datanucleus.store.mapped.expression.ExpressionPatternAdapter, org.datanucleus.store.rdbms.adapter.RDBMSAdapter, SpatialRDBMSAdapter

public class MySQLSpatialAdapter
extends org.datanucleus.store.rdbms.adapter.MySQLAdapter
implements SpatialRDBMSAdapter

Provides methods for adapting SQL language elements for MySQL spatial elements.


Field Summary
 
Fields inherited from class org.datanucleus.store.rdbms.adapter.MySQLAdapter
NONSQL92_RESERVED_WORDS
 
Fields inherited from class org.datanucleus.store.rdbms.adapter.DatabaseAdapter
catalogSeparator, datastoreMajorVersion, datastoreMinorVersion, datastoreProductName, datastoreProductVersion, datastoreRevisionVersion, driverMajorVersion, driverMinorVersion, driverName, driverVersion, identifierQuoteString, LOCALISER, LOCALISER_BASE, maxColumnNameLength, maxConstraintNameLength, maxIndexNameLength, maxTableNameLength, properties, reservedKeywords, supportedOptions
 
Fields inherited from interface org.datanucleus.store.rdbms.adapter.SpatialRDBMSAdapter
DIMENSION_EXTENSION_KEY, SRID_EXTENSION_KEY
 
Fields inherited from interface org.datanucleus.store.rdbms.adapter.RDBMSAdapter
ACCESS_PARENTQUERY_IN_SUBQUERY, ALTER_TABLE_DROP_CONSTRAINT_SYNTAX, ALTER_TABLE_DROP_FOREIGN_KEY_CONSTRAINT, ANSI_JOIN_SYNTAX, AUTO_INCREMENT_COLUMN_TYPE_SPECIFICATION, AUTO_INCREMENT_KEYS_NULL_SPECIFICATION, BLOB_SET_USING_SETSTRING, CHAR_COLUMNS_PADDED_WITH_SPACES, CHECK_IN_CREATE_STATEMENTS, CHECK_IN_END_CREATE_STATEMENTS, CLOB_SET_USING_SETSTRING, CREATE_INDEXES_BEFORE_FOREIGN_KEYS, DATETIME_STORES_MILLISECS, DEFAULT_BEFORE_NULL_IN_COLUMN_OPTIONS, DEFAULT_KEYWORD_IN_COLUMN_OPTIONS, DEFAULT_KEYWORD_WITH_NOT_NULL_IN_COLUMN_OPTIONS, DEFERRED_CONSTRAINTS, DISTINCT_WITH_SELECT_FOR_UPDATE, EXISTS_SYNTAX, FK_DELETE_ACTION_CASCADE, FK_DELETE_ACTION_DEFAULT, FK_DELETE_ACTION_NULL, FK_DELETE_ACTION_RESTRICT, FK_UPDATE_ACTION_CASCADE, FK_UPDATE_ACTION_DEFAULT, FK_UPDATE_ACTION_NULL, FK_UPDATE_ACTION_RESTRICT, GET_GENERATED_KEYS_STATEMENT, INCLUDE_ORDERBY_COLS_IN_SELECT, LOCK_OPTION_PLACED_AFTER_FROM, LOCK_OPTION_PLACED_WITHIN_JOIN, LOCK_WITH_SELECT_FOR_UPDATE, NULL_EQUALS_EMPTY_STRING, NULLS_IN_CANDIDATE_KEYS, NULLS_KEYWORD_IN_COLUMN_OPTIONS, ORDERBY_USING_SELECT_COLUMN_INDEX, PERSIST_OF_UNASSIGNED_CHAR, PRIMARYKEY_IN_CREATE_STATEMENTS, STATEMENT_BATCHING, TX_ISOLATION_NONE, TX_ISOLATION_READ_COMMITTED, TX_ISOLATION_READ_UNCOMMITTED, TX_ISOLATION_REPEATABLE_READ, TX_ISOLATION_SERIALIZABLE, UNION_SYNTAX, UNIQUE_IN_END_CREATE_STATEMENTS, USE_UNION_ALL, VIEWS
 
Fields inherited from interface org.datanucleus.store.mapped.DatastoreAdapter
ANALYSIS_METHODS, BIT_IS_REALLY_BOOLEAN, BOOLEAN_COMPARISON, CATALOGS_IN_TABLE_DEFINITIONS, ESCAPE_EXPRESSION_IN_LIKE_PREDICATE, IDENTIFIERS_LOWERCASE, IDENTIFIERS_LOWERCASE_QUOTED, IDENTIFIERS_MIXEDCASE, IDENTIFIERS_MIXEDCASE_QUOTED, IDENTIFIERS_MIXEDCASE_QUOTED_SENSITIVE, IDENTIFIERS_MIXEDCASE_SENSITIVE, IDENTIFIERS_UPPERCASE, IDENTIFIERS_UPPERCASE_QUOTED, IDENTITY_COLUMNS, PROJECTION_IN_TABLE_REFERENCE_JOINS, SCHEMAS_IN_TABLE_DEFINITIONS, SEQUENCES
 
Constructor Summary
MySQLSpatialAdapter(java.sql.DatabaseMetaData metadata)
           
 
Method Summary
 java.lang.String getCalculateBoundsStatement(org.datanucleus.store.rdbms.table.Table table, org.datanucleus.store.rdbms.table.Column column)
          Returns the appropriate SQL statement that calculates the bounds of all geometries in the given column.
 java.lang.String getRetrieveCrsNameStatement(org.datanucleus.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.datanucleus.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.
 void initialiseTypes(org.datanucleus.store.schema.StoreSchemaHandler handler, org.datanucleus.ManagedConnection mconn)
          Initialise the types for this datastore.
 boolean isGeometryColumn(org.datanucleus.store.rdbms.table.Column c)
          Checks whether the given column is geometry backed by the datastore.
 
Methods inherited from class org.datanucleus.store.rdbms.adapter.MySQLAdapter
cartersianProduct, concatOperator, getAddColumnStatement, getAddPrimaryKeyStatement, getAutoIncrementKeyword, getAutoIncrementStmt, getCreateTableStatement, getDropTableStatement, getEscapePatternExpression, getRangeByLimitWhereClause, getSelectNewUUIDStmt, getVendorID, newRDBMSColumnInfo, newSQLTypeInfo, startsWithMethod, toStringExpression
 
Methods inherited from class org.datanucleus.store.rdbms.adapter.DatabaseAdapter
addSQLTypeForJDBCType, endsWithMethod, getAdapterTime, getAddCandidateKeyStatement, getAddForeignKeyStatement, getCatalogName, getCatalogSeparator, getCheckConstraintForValues, getColumns, getConnection, getContinuationString, getCreateIndexStatement, getCurrentDateMethod, getCurrentTimeMethod, getCurrentTimestampMethod, getDatastoreDateStatement, getDatastoreIdentifierMaxLength, getDatastoreMajorVersion, getDatastoreMinorVersion, getDriverMajorVersion, getDriverMinorVersion, getDropViewStatement, getEscapeCharacter, getEscapedPatternExpression, getExistingIndexes, getIdentifierQuoteString, getInsertStatementForNoColumns, getMapping, getMappingManager, getMaxForeignKeys, getMaxIndexes, getMiliseconds, getNewUUIDFunction, getNonAnsiInnerJoinWhereClause, getNonAnsiLeftOuterJoinWhereClause, getNonAnsiRightOuterJoinWhereClause, getNumericConversionFunction, getNumericExpressionForMethod, getOperatorConcat, getPatternExpressionAnyCharacter, getPatternExpressionZeroMoreCharacters, getRangeByLimitSelectClause, getRangeByRowNumberColumn, getRequiredTransactionIsolationLevel, getSchemaName, getSelectForUpdateText, getSelectWithLockOption, getSequenceCreateStmt, getSequenceNextStmt, getSupportedOptions, getSurrogateForEmptyStrings, getTime, getTransactionIsolationForSchemaCreation, getUnlimitedLengthPrecisionValue, getValueForProperty, indexOfMethod, initialiseDatastore, isIdentityFieldDataType, isKeyword, isReservedKeyword, isValidPrimaryKeyType, iteratorReservedWords, logConfiguration, lowerMethod, matchesMethod, modOperator, newFKInfo, newQueryStatement, newTableExpression, parseKeywordList, removeUnsupportedMappings, setProperties, substringMethod, substringMethod, supportsOption, supportsQueryFetchSize, supportsTransactionIsolation, toNumericExpression, toString, toStringExpression, translateMethod, trimMethod, upperMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.datanucleus.store.rdbms.adapter.RDBMSAdapter
getAddCandidateKeyStatement, getAddColumnStatement, getAddForeignKeyStatement, getAddPrimaryKeyStatement, getAutoIncrementKeyword, getAutoIncrementStmt, getCatalogName, getCheckConstraintForValues, getColumns, getConnection, getCreateIndexStatement, getCreateTableStatement, getDatastoreDateStatement, getDropTableStatement, getDropViewStatement, getExistingIndexes, getInsertStatementForNoColumns, getNonAnsiInnerJoinWhereClause, getNonAnsiLeftOuterJoinWhereClause, getRangeByLimitSelectClause, getRangeByLimitWhereClause, getRangeByRowNumberColumn, getRequiredTransactionIsolationLevel, getSchemaName, getSelectNewUUIDStmt, getSelectWithLockOption, getSequenceCreateStmt, getSequenceNextStmt, getSurrogateForEmptyStrings, getTransactionIsolationForSchemaCreation, getUnlimitedLengthPrecisionValue, isValidPrimaryKeyType, iteratorReservedWords, logConfiguration, newFKInfo, newRDBMSColumnInfo, newSQLTypeInfo, newTableExpression, supportsTransactionIsolation
 
Methods inherited from interface org.datanucleus.store.mapped.DatastoreAdapter
getAdapterTime, getCatalogSeparator, getDatastoreIdentifierMaxLength, getDatastoreMajorVersion, getDatastoreMinorVersion, getIdentifierQuoteString, getMappingManager, getMaxForeignKeys, getMaxIndexes, getNumericExpressionForMethod, getSupportedOptions, getVendorID, initialiseDatastore, isIdentityFieldDataType, isReservedKeyword, modOperator, newQueryStatement, removeUnsupportedMappings, setProperties, supportsOption, supportsQueryFetchSize, toString
 
Methods inherited from interface org.datanucleus.store.mapped.expression.ExpressionConversionAdapter
toNumericExpression, toStringExpression, toStringExpression
 
Methods inherited from interface org.datanucleus.store.mapped.expression.ExpressionOperatorAdapter
concatOperator, getOperatorConcat
 
Methods inherited from interface org.datanucleus.store.mapped.expression.ExpressionMethodAdapter
endsWithMethod, getCurrentDateMethod, getCurrentTimeMethod, getCurrentTimestampMethod, indexOfMethod, lowerMethod, matchesMethod, startsWithMethod, substringMethod, substringMethod, translateMethod, trimMethod, upperMethod
 
Methods inherited from interface org.datanucleus.store.mapped.expression.ExpressionPatternAdapter
getEscapeCharacter, getEscapedPatternExpression, getEscapePatternExpression, getPatternExpressionAnyCharacter, getPatternExpressionZeroMoreCharacters
 
Methods inherited from interface org.datanucleus.store.mapped.expression.ExpressionLogicSetAdapter
cartersianProduct
 

Constructor Detail

MySQLSpatialAdapter

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

initialiseTypes

public void initialiseTypes(org.datanucleus.store.schema.StoreSchemaHandler handler,
                            org.datanucleus.ManagedConnection mconn)
Initialise the types for this datastore.

Specified by:
initialiseTypes in interface org.datanucleus.store.mapped.DatastoreAdapter
Overrides:
initialiseTypes in class org.datanucleus.store.rdbms.adapter.MySQLAdapter
Parameters:
handler - SchemaHandler that we initialise the types for
mconn - Managed connection to use

isGeometryColumn

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

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

getRetrieveCrsNameStatement

public java.lang.String getRetrieveCrsNameStatement(org.datanucleus.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

getRetrieveCrsWktStatement

public java.lang.String getRetrieveCrsWktStatement(org.datanucleus.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

getCalculateBoundsStatement

public java.lang.String getCalculateBoundsStatement(org.datanucleus.store.rdbms.table.Table table,
                                                    org.datanucleus.store.rdbms.table.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


Copyright © 2009. All Rights Reserved.