org.hibernate.spatial.dialect.mysql
Class MySQLSpatialInnoDBDialect

java.lang.Object
  extended by org.hibernate.dialect.Dialect
      extended by org.hibernate.dialect.MySQLDialect
          extended by org.hibernate.dialect.MySQLInnoDBDialect
              extended by org.hibernate.spatial.dialect.mysql.MySQLSpatialInnoDBDialect
All Implemented Interfaces:
java.io.Serializable, org.hibernate.exception.spi.ConversionContext, SpatialDialect

public class MySQLSpatialInnoDBDialect
extends org.hibernate.dialect.MySQLInnoDBDialect
implements SpatialDialect

Extends the MySQLInnoDBDialect by also including information on spatial operators, constructors and processing functions. This is a mere wrapper class for dialect functionality defined in MySQLSpatialDialect

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, DEFAULT_BATCH_SIZE, NO_BATCH, QUOTE
 
Constructor Summary
MySQLSpatialInnoDBDialect()
           
 
Method Summary
 java.lang.String getDbGeometryTypeName()
           
 java.lang.String getDWithinSQL(java.lang.String columnName)
          Returns the SQL fragment when parsing a DWithinExpression.
 java.lang.String getHavingSridSQL(java.lang.String columnName)
          Returns the SQL fragment when parsing an HavingSridExpression.
 java.lang.String getIsEmptySQL(java.lang.String columnName, boolean isEmpty)
          Returns the SQL fragment when parsing a IsEmptyExpression or IsNotEmpty expression.
 java.lang.String getSpatialAggregateSQL(java.lang.String columnName, int aggregation)
           
 java.lang.String getSpatialFilterExpression(java.lang.String columnName)
          Returns the SQL fragment for the SQL WHERE-expression when parsing org.hibernate.spatial.criterion.SpatialFilterExpressions into prepared statements.
 java.lang.String getSpatialRelateSQL(java.lang.String columnName, int spatialRelation)
          Returns the SQL fragment for the SQL WHERE-clause when parsing org.hibernatespatial.criterion.SpatialRelateExpressions into prepared statements.
 java.lang.String getTypeName(int code, long length, int precision, int scale)
          Get the name of the database type associated with the given Types typecode with the given storage specification parameters.
 org.hibernate.type.descriptor.sql.SqlTypeDescriptor remapSqlTypeDescriptor(org.hibernate.type.descriptor.sql.SqlTypeDescriptor sqlTypeDescriptor)
          Allows the dialect to override a SqlTypeDescriptor.
 boolean supports(SpatialFunction function)
          Does this dialect supports the specified SpatialFunction.
 boolean supportsFiltering()
          Returns true if this SpatialDialect supports a specific filtering function.
 
Methods inherited from class org.hibernate.dialect.MySQLInnoDBDialect
getTableTypeString, hasSelfReferentialForeignKeyBug, supportsCascadeDelete
 
Methods inherited from class org.hibernate.dialect.MySQLDialect
areStringComparisonsCaseInsensitive, buildSQLExceptionConversionDelegate, closeQuote, getAddColumnString, getAddForeignKeyConstraintString, getCastTypeName, getColumnComment, getCreateTemporaryTableString, getCurrentTimestampSelectString, getDropForeignKeyString, getDropTemporaryTableString, getForUpdateString, getIdentityColumnString, getIdentitySelectString, getLimitString, getNotExpression, getReadLockString, getResultSet, getSelectGUIDString, getTableComment, getWriteLockString, isCurrentTimestampSelectStringCallable, openQuote, performTemporaryTableDDLInIsolation, qualifyIndexName, registerResultSetOutParameter, supportsCurrentTimestampSelection, supportsEmptyInList, supportsIdentityColumns, supportsIfExistsBeforeTableName, supportsLimit, supportsLobValueChangePropogation, supportsLockTimeouts, supportsRowValueConstructorSyntax, supportsSubqueryOnMutatingTable, supportsTemporaryTables
 
Methods inherited from class org.hibernate.dialect.Dialect
appendIdentitySelectToInsert, appendLockHint, appendLockHint, applyLocksToSql, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildLimitHandler, buildSQLExceptionConverter, cast, cast, cast, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, dropConstraints, dropTemporaryTableAfterUse, forceLimitUsage, forceLobAsLastValue, forUpdateOfColumns, generateTemporaryTableName, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getCascadeConstraintsString, getCaseInsensitiveLike, getColumnAliasExtractor, getCreateMultisetTableString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCreateTemporaryTablePostfix, getCrossJoinSeparator, getCurrentTimestampSQLFunctionName, getDefaultProperties, getDialect, getDialect, getDropSequenceStrings, getDropTableString, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIdentityColumnString, getIdentityInsertString, getIdentitySelectString, getInExpressionCountLimit, getKeywords, getLimitString, getLobMergeStrategy, getLockingStrategy, getLowercaseFunction, getMaxAliasLength, getNativeIdentifierGeneratorClass, getNoColumnsInsertString, getNullColumnString, getQuerySequencesString, getSelectClauseNullString, getSelectSequenceNextValString, getSequenceNextValString, getTypeName, getViolatedConstraintNameExtracter, hasAlterTable, hasDataTypeInIdentityColumn, isLockTimeoutParameterized, quote, replaceResultVariableInOrderByClauseWithPosition, requiresCastingOfParametersInSelectClause, supportsBindAsCallableArgument, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsCommentOn, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsIfExistsAfterTableName, supportsInsertSelectIdentity, supportsLimitOffset, supportsNotNullUnique, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPooledSequences, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntaxInInList, supportsSequences, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTupleCounts, supportsTupleDistinctCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsVariableLimit, toBooleanValueString, toString, transformSelectString, useFollowOnLocking, useInputStreamToInsertBlob, useMaxForLimit
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MySQLSpatialInnoDBDialect

public MySQLSpatialInnoDBDialect()
Method Detail

remapSqlTypeDescriptor

public org.hibernate.type.descriptor.sql.SqlTypeDescriptor remapSqlTypeDescriptor(org.hibernate.type.descriptor.sql.SqlTypeDescriptor sqlTypeDescriptor)
Description copied from class: org.hibernate.dialect.Dialect
Allows the dialect to override a SqlTypeDescriptor.

If the passed sqlTypeDescriptor allows itself to be remapped (per SqlTypeDescriptor.canBeRemapped()), then this method uses Dialect.getSqlTypeDescriptorOverride(int) to get an optional override based on the SQL code returned by SqlTypeDescriptor.getSqlType().

If this dialect does not provide an override or if the sqlTypeDescriptor doe not allow itself to be remapped, then this method simply returns the original passed sqlTypeDescriptor

Overrides:
remapSqlTypeDescriptor in class org.hibernate.dialect.Dialect
Parameters:
sqlTypeDescriptor - The SqlTypeDescriptor to override
Returns:
The SqlTypeDescriptor that should be used for this dialect; if there is no override, then original sqlTypeDescriptor is returned.
See Also:
Dialect.getSqlTypeDescriptorOverride(int)

getTypeName

public java.lang.String getTypeName(int code,
                                    long length,
                                    int precision,
                                    int scale)
                             throws org.hibernate.HibernateException
Description copied from class: org.hibernate.dialect.Dialect
Get the name of the database type associated with the given Types typecode with the given storage specification parameters.

Overrides:
getTypeName in class org.hibernate.dialect.Dialect
Parameters:
code - The Types typecode
length - The datatype length
precision - The datatype precision
scale - The datatype scale
Returns:
the database type name
Throws:
org.hibernate.HibernateException - If no mapping was specified for that type.

getSpatialRelateSQL

public java.lang.String getSpatialRelateSQL(java.lang.String columnName,
                                            int spatialRelation)
Description copied from interface: SpatialDialect
Returns the SQL fragment for the SQL WHERE-clause when parsing org.hibernatespatial.criterion.SpatialRelateExpressions into prepared statements.

Specified by:
getSpatialRelateSQL in interface SpatialDialect
Parameters:
columnName - The name of the geometry-typed column to which the relation is applied
spatialRelation - The type of spatial relation (as defined in SpatialRelation).
Returns:
SQL fragment for use in the SQL WHERE-clause.

getSpatialFilterExpression

public java.lang.String getSpatialFilterExpression(java.lang.String columnName)
Description copied from interface: SpatialDialect
Returns the SQL fragment for the SQL WHERE-expression when parsing org.hibernate.spatial.criterion.SpatialFilterExpressions into prepared statements.

Specified by:
getSpatialFilterExpression in interface SpatialDialect
Returns:

getSpatialAggregateSQL

public java.lang.String getSpatialAggregateSQL(java.lang.String columnName,
                                               int aggregation)
Specified by:
getSpatialAggregateSQL in interface SpatialDialect
Parameters:
columnName - the name of the Geometry property
aggregation - the type of SpatialAggregate
Returns:
the SQL fragment for the projection

getDWithinSQL

public java.lang.String getDWithinSQL(java.lang.String columnName)
Description copied from interface: SpatialDialect
Returns the SQL fragment when parsing a DWithinExpression.

Specified by:
getDWithinSQL in interface SpatialDialect
Parameters:
columnName - the geometry column to test against
Returns:

getHavingSridSQL

public java.lang.String getHavingSridSQL(java.lang.String columnName)
Description copied from interface: SpatialDialect
Returns the SQL fragment when parsing an HavingSridExpression.

Specified by:
getHavingSridSQL in interface SpatialDialect
Parameters:
columnName - the geometry column to test against
Returns:

getIsEmptySQL

public java.lang.String getIsEmptySQL(java.lang.String columnName,
                                      boolean isEmpty)
Description copied from interface: SpatialDialect
Returns the SQL fragment when parsing a IsEmptyExpression or IsNotEmpty expression.

Specified by:
getIsEmptySQL in interface SpatialDialect
Parameters:
columnName - the geometry column
isEmpty - whether the geometry is tested for empty or non-empty
Returns:

getDbGeometryTypeName

public java.lang.String getDbGeometryTypeName()

supportsFiltering

public boolean supportsFiltering()
Description copied from interface: SpatialDialect
Returns true if this SpatialDialect supports a specific filtering function.

This is intended to signal DB-support for fast window queries, or MBR-overlap queries

Specified by:
supportsFiltering in interface SpatialDialect

supports

public boolean supports(SpatialFunction function)
Description copied from interface: SpatialDialect
Does this dialect supports the specified SpatialFunction.

Specified by:
supports in interface SpatialDialect
Parameters:
function - SpatialFunction
Returns:
true if this SpatialDialect supports the spatial function specified by the function parameter.