Class PostgisPG94Dialect
- java.lang.Object
-
- org.hibernate.dialect.Dialect
-
- org.hibernate.dialect.PostgreSQL81Dialect
-
- org.hibernate.dialect.PostgreSQL82Dialect
-
- org.hibernate.dialect.PostgreSQL9Dialect
-
- org.hibernate.dialect.PostgreSQL91Dialect
-
- org.hibernate.dialect.PostgreSQL92Dialect
-
- org.hibernate.dialect.PostgreSQL93Dialect
-
- org.hibernate.dialect.PostgreSQL94Dialect
-
- org.hibernate.spatial.dialect.postgis.PostgisPG94Dialect
-
- All Implemented Interfaces:
java.io.Serializable
,ConversionContext
,SpatialDialect
public class PostgisPG94Dialect extends PostgreSQL94Dialect implements SpatialDialect
Extends thePostgreSQL94Dialect
to add support for the Postgis spatial types, functions and operators .Created by Karel Maesen, Geovise BVBA on 01/11/16.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, DEFAULT_BATCH_SIZE, LEGACY_LOB_MERGE_STRATEGY, NEW_LOCATOR_LOB_MERGE_STRATEGY, NO_BATCH, QUOTE, STANDARD_DEFAULT_BATCH_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGY, TWO_SINGLE_QUOTES_REPLACEMENT
-
-
Constructor Summary
Constructors Constructor Description PostgisPG94Dialect()
Creates an instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry)
Allows the Dialect to contribute additional typesboolean
equivalentTypes(int typeCode1, int typeCode2)
Do the given JDBC type codes, as defined inTypes
represent essentially the same type in this dialect of SQL? The default implementation treatsNUMERIC
andDECIMAL
as the same type, andFLOAT
,REAL
, andDOUBLE
as essentially the same type, since the ANSI SQL specification fails to meaningfully distinguish them.java.lang.String
getDWithinSQL(java.lang.String columnName)
Returns The SQL fragment when parsing aDWithinExpression
.java.lang.String
getHavingSridSQL(java.lang.String columnName)
Returns the SQL fragment when parsing aHavingSridExpression
.java.lang.String
getIsEmptySQL(java.lang.String columnName, boolean isEmpty)
Returns the SQL fragment when parsing aIsEmptyExpression
orIsNotEmpty
expression.java.lang.String
getSpatialAggregateSQL(java.lang.String columnName, int aggregation)
Returns the SQL fragment for the specfied Spatial aggregate expression.java.lang.String
getSpatialFilterExpression(java.lang.String columnName)
Returns the SQL fragment for the SQL WHERE-expression when parsingorg.hibernate.spatial.criterion.SpatialFilterExpression
s into prepared statements.java.lang.String
getSpatialRelateSQL(java.lang.String columnName, int spatialRelation)
Returns the SQL fragment for the SQL WHERE-clause when parsingorg.hibernatespatial.criterion.SpatialRelateExpression
s into prepared statements.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.PostgreSQL93Dialect
augmentRecognizedTableTypes
-
Methods inherited from class org.hibernate.dialect.PostgreSQL92Dialect
supportsIfExistsAfterAlterTable
-
Methods inherited from class org.hibernate.dialect.PostgreSQL91Dialect
supportsNonQueryWithCTE, supportsPartitionBy
-
Methods inherited from class org.hibernate.dialect.PostgreSQL9Dialect
supportsIfExistsBeforeConstraintName
-
Methods inherited from class org.hibernate.dialect.PostgreSQL82Dialect
getDefaultMultiTableBulkIdStrategy, getDropSequenceString, supportsIfExistsBeforeTableName, supportsRowValueConstructorSyntaxInInList, supportsValuesList
-
Methods inherited from class org.hibernate.dialect.PostgreSQL81Dialect
bindLimitParametersInReverseOrder, buildIdentifierHelper, buildSQLExceptionConversionDelegate, dropConstraints, getAddColumnString, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getCreateSequenceString, getCreateSequenceString, getCurrentSchemaCommand, getCurrentTimestampSelectString, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getForUpdateString, getForUpdateString, getIdentityColumnSupport, getLimitHandler, getLimitString, getNameQualifierSupport, getNativeIdentifierGeneratorStrategy, getNoColumnsInsertString, getQuerySequencesString, getReadLockString, getReadLockString, getResultSet, getResultSet, getResultSet, getSelectClauseNullString, getSelectSequenceNextValString, getSequenceNextValString, getSqlTypeDescriptorOverride, getViolatedConstraintNameExtracter, getWriteLockString, getWriteLockString, isCurrentTimestampSelectStringCallable, qualifyIndexName, registerResultSetOutParameter, requiresParensForTupleDistinctCounts, supportsCaseInsensitiveLike, supportsCommentOn, supportsCurrentTimestampSelection, supportsEmptyInList, supportsExpectedLobUsagePattern, supportsJdbcConnectionLobCreation, supportsLimit, supportsLobValueChangePropogation, supportsNationalizedTypes, supportsNoWait, supportsOuterJoinForUpdate, supportsPooledSequences, supportsRowValueConstructorSyntax, supportsSelectAliasInGroupByClause, supportsSequences, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, toBooleanValueString, useInputStreamToInsertBlob
-
Methods inherited from class org.hibernate.dialect.Dialect
addSqlHintOrComment, appendLockHint, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, augmentPhysicalTableTypes, bindLimitParametersFirst, buildSQLExceptionConverter, canCreateCatalog, canCreateSchema, cast, cast, cast, closeQuote, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, defaultScrollMode, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, escapeComment, escapeLiteral, forceLimitUsage, forceLobAsLastValue, forUpdateOfColumns, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getAlterTableString, getAuxiliaryDatabaseObjectExporter, getCastTypeName, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateMultisetTableString, getCreateSchemaCommand, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCrossJoinSeparator, getCurrentTimestampSQLFunctionName, getDefaultBatchLoadSizingStrategy, getDefaultProperties, getDialect, getDialect, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, getDropSequenceStrings, getDropTableString, getForeignKeyExporter, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIndexExporter, getInExpressionCountLimit, getKeywords, getLimitString, getLobMergeStrategy, getLockingStrategy, getLowercaseFunction, getMaxAliasLength, getNativeIdentifierGeneratorClass, getNotExpression, getNullColumnString, getQueryHintString, getQueryHintString, getSchemaNameResolver, getSelectGUIDString, getSequenceExporter, getSequenceInformationExtractor, getTableComment, getTableExporter, getTableTypeString, getTypeName, getTypeName, getUniqueDelegate, getUniqueKeyExporter, hasAlterTable, hasSelfReferentialForeignKeyBug, inlineLiteral, isJdbcLogWarningsEnabledByDefault, isLegacyLimitHandlerBehaviorEnabled, isLockTimeoutParameterized, isTypeNameRegistered, openQuote, prependComment, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, remapSqlTypeDescriptor, renderOrderByElement, replaceResultVariableInOrderByClauseWithPosition, requiresCastingOfParametersInSelectClause, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsExistsInSelect, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsLimitOffset, supportsLockTimeouts, supportsNamedParameters, supportsNoColumnsInsert, supportsNotNullUnique, supportsParametersInInsertSelect, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntaxInSet, supportsSkipLocked, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTupleCounts, supportsTupleDistinctCounts, supportsTuplesInSubqueries, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsVariableLimit, toString, transformSelectString, useFollowOnLocking, useFollowOnLocking, useMaxForLimit
-
-
-
-
Method Detail
-
contributeTypes
public void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry)
Description copied from class:Dialect
Allows the Dialect to contribute additional types- Overrides:
contributeTypes
in classPostgreSQL82Dialect
- Parameters:
typeContributions
- Callback to contribute the typesserviceRegistry
- The service registry
-
equivalentTypes
public boolean equivalentTypes(int typeCode1, int typeCode2)
Description copied from class:Dialect
Do the given JDBC type codes, as defined inTypes
represent essentially the same type in this dialect of SQL? The default implementation treatsNUMERIC
andDECIMAL
as the same type, andFLOAT
,REAL
, andDOUBLE
as essentially the same type, since the ANSI SQL specification fails to meaningfully distinguish them.- Overrides:
equivalentTypes
in classDialect
- Parameters:
typeCode1
- the first JDBC type codetypeCode2
- the second JDBC type code- Returns:
true
if the two type codes are equivalent
-
getSpatialRelateSQL
public java.lang.String getSpatialRelateSQL(java.lang.String columnName, int spatialRelation)
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 java.lang.String getSpatialFilterExpression(java.lang.String columnName)
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 java.lang.String getSpatialAggregateSQL(java.lang.String columnName, int aggregation)
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 java.lang.String getDWithinSQL(java.lang.String columnName)
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 java.lang.String getHavingSridSQL(java.lang.String columnName)
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 java.lang.String getIsEmptySQL(java.lang.String columnName, boolean isEmpty)
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()
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)
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.
-
-