Class MySQL56SpatialDialect
- java.lang.Object
-
- org.hibernate.dialect.Dialect
-
- org.hibernate.dialect.MySQLDialect
-
- org.hibernate.dialect.MySQL5Dialect
-
- org.hibernate.dialect.MySQL55Dialect
-
- org.hibernate.spatial.dialect.mysql.MySQL56SpatialDialect
-
- All Implemented Interfaces:
Serializable
,org.hibernate.exception.spi.ConversionContext
,SpatialDialect
- Direct Known Subclasses:
MySQL56InnoDBSpatialDialect
public class MySQL56SpatialDialect extends org.hibernate.dialect.MySQL55Dialect implements SpatialDialect
Extends the MySQL5Dialect by including support for the spatial operators.This
SpatialDialect
uses the ST_* spatial operators that operate on exact geometries which have been added in MySQL version 5.6.1. Previous versions of MySQL only supported operators that operated on Minimum Bounding Rectangles (MBR's). This dialect my therefore produce different results than the other MySQL spatial dialects.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MySQL56SpatialDialect()
Constructs the dialect
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
contributeTypes(org.hibernate.boot.model.TypeContributions typeContributions, org.hibernate.service.ServiceRegistry serviceRegistry)
Allows the Dialect to contribute additional typesString
getDWithinSQL(String columnName)
Returns The SQL fragment when parsing aDWithinExpression
.String
getHavingSridSQL(String columnName)
Returns the SQL fragment when parsing aHavingSridExpression
.String
getIsEmptySQL(String columnName, boolean isEmpty)
Returns the SQL fragment when parsing aIsEmptyExpression
orIsNotEmpty
expression.String
getSpatialAggregateSQL(String columnName, int aggregation)
Returns the SQL fragment for the specfied Spatial aggregate expression.String
getSpatialFilterExpression(String columnName)
Returns the SQL fragment for the SQL WHERE-expression when parsingorg.hibernate.spatial.criterion.SpatialFilterExpression
s into prepared statements.String
getSpatialRelateSQL(String columnName, int spatialRelation)
Returns the SQL fragment for the SQL WHERE-clause when parsingorg.hibernatespatial.criterion.SpatialRelateExpression
s into prepared statements.String
getTypeName(int code, long length, int precision, int scale)
org.hibernate.type.descriptor.sql.SqlTypeDescriptor
remapSqlTypeDescriptor(org.hibernate.type.descriptor.sql.SqlTypeDescriptor sqlTypeDescriptor)
boolean
supports(SpatialFunction function)
Does this dialect supports the specifiedSpatialFunction
.boolean
supportsFiltering()
Returns true if thisSpatialDialect
supports a specific filtering function.-
Methods inherited from class org.hibernate.dialect.MySQL5Dialect
getEngineKeyword, getQueryHintString, getViolatedConstraintNameExtracter, registerVarcharTypes, supportsColumnCheck
-
Methods inherited from class org.hibernate.dialect.MySQLDialect
areStringComparisonsCaseInsensitive, buildSQLExceptionConversionDelegate, canCreateCatalog, canCreateSchema, closeQuote, dropConstraints, escapeLiteral, fixedPointNumberCastTarget, floatingPointNumberCastTarget, getAddColumnString, getAddForeignKeyConstraintString, getCastTypeName, getColumnComment, getCreateCatalogCommand, getCreateSchemaCommand, getCurrentTimestampSelectString, getDefaultMultiTableBulkIdStrategy, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, getForUpdateString, getIdentityColumnSupport, getLimitHandler, getLimitString, getNotExpression, getReadLockString, getResultSet, getSelectGUIDString, getTableComment, getTableTypeString, getUniqueDelegate, getWriteLockString, hasSelfReferentialForeignKeyBug, isCurrentTimestampSelectStringCallable, isJdbcLogWarningsEnabledByDefault, openQuote, qualifyIndexName, registerResultSetOutParameter, renderOrderByElement, smallIntegerCastTarget, supportsCascadeDelete, supportsCurrentTimestampSelection, supportsEmptyInList, supportsIfExistsBeforeTableName, supportsLimit, supportsLobValueChangePropogation, supportsLockTimeouts, supportsRowValueConstructorSyntax, supportsSubqueryOnMutatingTable
-
Methods inherited from class org.hibernate.dialect.Dialect
addSqlHintOrComment, appendLockHint, appendLockHint, applyLocksToSql, augmentRecognizedTableTypes, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildIdentifierHelper, buildSQLExceptionConverter, cast, cast, cast, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, defaultScrollMode, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, escapeComment, forceLimitUsage, forceLobAsLastValue, forUpdateOfColumns, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getAlterTableString, getAuxiliaryDatabaseObjectExporter, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getColumnAliasExtractor, getCreateMultisetTableString, getCreateSequenceString, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCrossJoinSeparator, getCurrentSchemaCommand, getCurrentTimestampSQLFunctionName, getDefaultBatchLoadSizingStrategy, getDefaultProperties, getDialect, getDialect, getDropSequenceString, getDropSequenceStrings, getDropTableString, getForeignKeyExporter, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIndexExporter, getInExpressionCountLimit, getKeywords, getLimitString, getLobMergeStrategy, getLockingStrategy, getLowercaseFunction, getMaxAliasLength, getNameQualifierSupport, getNativeIdentifierGeneratorClass, getNativeIdentifierGeneratorStrategy, getNoColumnsInsertString, getNullColumnString, getQueryHintString, getQuerySequencesString, getReadLockString, getResultSet, getResultSet, getSchemaNameResolver, getSelectClauseNullString, getSelectSequenceNextValString, getSequenceExporter, getSequenceInformationExtractor, getSequenceNextValString, getSqlTypeDescriptorOverride, getTableExporter, getTypeName, getUniqueKeyExporter, getWriteLockString, hasAlterTable, inlineLiteral, isLegacyLimitHandlerBehaviorEnabled, isLockTimeoutParameterized, isTypeNameRegistered, prependComment, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, replaceResultVariableInOrderByClauseWithPosition, requiresCastingOfParametersInSelectClause, requiresParensForTupleDistinctCounts, supportsBindAsCallableArgument, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsCommentOn, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsBeforeConstraintName, supportsLimitOffset, supportsNamedParameters, supportsNationalizedTypes, supportsNonQueryWithCTE, supportsNotNullUnique, supportsNoWait, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPartitionBy, supportsPooledSequences, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntaxInInList, supportsSequences, supportsSkipLocked, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTupleCounts, supportsTupleDistinctCounts, supportsTuplesInSubqueries, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsValuesList, supportsVariableLimit, toBooleanValueString, toString, transformSelectString, useFollowOnLocking, useFollowOnLocking, useInputStreamToInsertBlob, useMaxForLimit
-
-
-
-
Method Detail
-
remapSqlTypeDescriptor
public org.hibernate.type.descriptor.sql.SqlTypeDescriptor remapSqlTypeDescriptor(org.hibernate.type.descriptor.sql.SqlTypeDescriptor sqlTypeDescriptor)
- Overrides:
remapSqlTypeDescriptor
in classorg.hibernate.dialect.Dialect
-
getTypeName
public String getTypeName(int code, long length, int precision, int scale) throws org.hibernate.HibernateException
- Overrides:
getTypeName
in classorg.hibernate.dialect.Dialect
- Throws:
org.hibernate.HibernateException
-
contributeTypes
public void contributeTypes(org.hibernate.boot.model.TypeContributions typeContributions, org.hibernate.service.ServiceRegistry serviceRegistry)
Allows the Dialect to contribute additional types- Overrides:
contributeTypes
in classorg.hibernate.dialect.Dialect
- Parameters:
typeContributions
- Callback to contribute the typesserviceRegistry
- The service registry
-
getSpatialRelateSQL
public String getSpatialRelateSQL(String columnName, int spatialRelation)
Description copied from interface:SpatialDialect
Returns the SQL fragment for the SQL WHERE-clause when parsingorg.hibernatespatial.criterion.SpatialRelateExpression
s into prepared statements.- Specified by:
getSpatialRelateSQL
in interfaceSpatialDialect
- Parameters:
columnName
- The name of the geometry-typed column to which the relation is appliedspatialRelation
- The type of spatial relation (as defined inSpatialRelation
).- Returns:
- SQL fragment
SpatialRelateExpression
-
getSpatialFilterExpression
public String getSpatialFilterExpression(String columnName)
Description copied from interface:SpatialDialect
Returns the SQL fragment for the SQL WHERE-expression when parsingorg.hibernate.spatial.criterion.SpatialFilterExpression
s into prepared statements.- Specified by:
getSpatialFilterExpression
in interfaceSpatialDialect
- Parameters:
columnName
- The name of the geometry-typed column to which the filter is be applied- Returns:
- Rhe SQL fragment for the
SpatialFilterExpression
-
getSpatialAggregateSQL
public String getSpatialAggregateSQL(String columnName, int aggregation)
Description copied from interface:SpatialDialect
Returns the SQL fragment for the specfied Spatial aggregate expression.- Specified by:
getSpatialAggregateSQL
in interfaceSpatialDialect
- Parameters:
columnName
- The name of the Geometry propertyaggregation
- The type ofSpatialAggregate
- Returns:
- The SQL fragment for the projection
-
getDWithinSQL
public String getDWithinSQL(String columnName)
Description copied from interface:SpatialDialect
Returns The SQL fragment when parsing aDWithinExpression
.- Specified by:
getDWithinSQL
in interfaceSpatialDialect
- Parameters:
columnName
- The geometry column to test against- Returns:
- The SQL fragment when parsing a
DWithinExpression
.
-
getHavingSridSQL
public String getHavingSridSQL(String columnName)
Description copied from interface:SpatialDialect
Returns the SQL fragment when parsing aHavingSridExpression
.- Specified by:
getHavingSridSQL
in interfaceSpatialDialect
- Parameters:
columnName
- The geometry column to test against- Returns:
- The SQL fragment for a
HavingSridExpression
.
-
getIsEmptySQL
public String getIsEmptySQL(String columnName, boolean isEmpty)
Description copied from interface:SpatialDialect
Returns the SQL fragment when parsing aIsEmptyExpression
orIsNotEmpty
expression.- Specified by:
getIsEmptySQL
in interfaceSpatialDialect
- Parameters:
columnName
- The geometry columnisEmpty
- Whether the geometry is tested for empty or non-empty- Returns:
- The SQL fragment for the isempty function
-
supportsFiltering
public boolean supportsFiltering()
Description copied from interface:SpatialDialect
Returns true if thisSpatialDialect
supports a specific filtering function.This is intended to signal DB-support for fast window queries, or MBR-overlap queries.
- Specified by:
supportsFiltering
in interfaceSpatialDialect
- Returns:
- True if filtering is supported
-
supports
public boolean supports(SpatialFunction function)
Description copied from interface:SpatialDialect
Does this dialect supports the specifiedSpatialFunction
.- Specified by:
supports
in interfaceSpatialDialect
- Parameters:
function
-SpatialFunction
- Returns:
- True if this
SpatialDialect
supports the spatial function specified by the function parameter.
-
-