Class GeoDBDialect

  • All Implemented Interfaces:
    Serializable, org.hibernate.exception.spi.ConversionContext, SpatialDialect

    public class GeoDBDialect
    extends org.hibernate.dialect.H2Dialect
    implements SpatialDialect
    Extends the H2Dialect by also including information on spatial functions.
    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
    • Constructor Summary

      Constructors 
      Constructor Description
      GeoDBDialect()
      Constructor.
    • 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)  
      String getDWithinSQL​(String columnName)
      Returns The SQL fragment when parsing a DWithinExpression.
      String getHavingSridSQL​(String columnName)
      Returns the SQL fragment when parsing a HavingSridExpression.
      String getIsEmptySQL​(String columnName, boolean isEmpty)
      Returns the SQL fragment when parsing a IsEmptyExpression or IsNotEmpty 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 parsing org.hibernate.spatial.criterion.SpatialFilterExpressions into prepared statements.
      String getSpatialRelateSQL​(String columnName, int spatialRelation)
      Returns the SQL fragment for the SQL WHERE-clause when parsing org.hibernatespatial.criterion.SpatialRelateExpressions into prepared statements.
      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.H2Dialect

        bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildSQLExceptionConversionDelegate, doesReadCommittedCauseWritersToBlockReaders, dropConstraints, getAddColumnString, getCreateSequenceString, getCurrentTimestampSelectString, getDefaultMultiTableBulkIdStrategy, getDropSequenceString, getForUpdateString, getIdentityColumnSupport, getLimitHandler, getLimitString, getQueryHintString, getQuerySequencesString, getSelectSequenceNextValString, getSequenceInformationExtractor, getSequenceNextValString, getViolatedConstraintNameExtracter, isCurrentTimestampSelectStringCallable, requiresParensForTupleDistinctCounts, supportsCurrentTimestampSelection, supportsIfExistsAfterTableName, supportsIfExistsBeforeConstraintName, supportsLimit, supportsLobValueChangePropogation, supportsPooledSequences, supportsSequences, supportsTuplesInSubqueries, supportsUnionAll
      • Methods inherited from class org.hibernate.dialect.Dialect

        addSqlHintOrComment, appendLockHint, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, augmentRecognizedTableTypes, buildIdentifierHelper, buildSQLExceptionConverter, canCreateCatalog, canCreateSchema, cast, cast, cast, closeQuote, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, defaultScrollMode, doesRepeatableReadCauseReadersToBlockWriters, escapeComment, escapeLiteral, forceLimitUsage, forceLobAsLastValue, forUpdateOfColumns, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getAlterTableString, getAuxiliaryDatabaseObjectExporter, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getCastTypeName, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateMultisetTableString, getCreateSchemaCommand, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCrossJoinSeparator, getCurrentSchemaCommand, getCurrentTimestampSQLFunctionName, getDefaultBatchLoadSizingStrategy, getDefaultProperties, getDialect, getDialect, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, 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, getNotExpression, getNullColumnString, getQueryHintString, getReadLockString, getReadLockString, getResultSet, getResultSet, getResultSet, getSchemaNameResolver, getSelectClauseNullString, getSelectGUIDString, getSequenceExporter, getSqlTypeDescriptorOverride, getTableComment, getTableExporter, getTableTypeString, getTypeName, getTypeName, getUniqueDelegate, getUniqueKeyExporter, getWriteLockString, getWriteLockString, hasAlterTable, hasSelfReferentialForeignKeyBug, inlineLiteral, isJdbcLogWarningsEnabledByDefault, isLegacyLimitHandlerBehaviorEnabled, isLockTimeoutParameterized, isTypeNameRegistered, openQuote, prependComment, qualifyIndexName, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, registerResultSetOutParameter, remapSqlTypeDescriptor, renderOrderByElement, replaceResultVariableInOrderByClauseWithPosition, requiresCastingOfParametersInSelectClause, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsCommentOn, supportsEmptyInList, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsBeforeTableName, supportsLimitOffset, supportsLockTimeouts, supportsNamedParameters, supportsNationalizedTypes, supportsNonQueryWithCTE, supportsNotNullUnique, supportsNoWait, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPartitionBy, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsSkipLocked, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTupleCounts, supportsTupleDistinctCounts, supportsUnboundedLobLocatorMaterialization, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsValuesList, supportsVariableLimit, toBooleanValueString, toString, transformSelectString, useFollowOnLocking, useFollowOnLocking, useInputStreamToInsertBlob, useMaxForLimit
    • Constructor Detail

      • GeoDBDialect

        public GeoDBDialect()
        Constructor. Registers OGC simple feature functions (see http://portal.opengeospatial.org/files/?artifact_id=829 for details).

        Note for the registerfunction method: it registers non-standard database functions: first argument is the internal (OGC standard) function name, second the name as it occurs in the spatial dialect

    • Method Detail

      • contributeTypes

        public void contributeTypes​(org.hibernate.boot.model.TypeContributions typeContributions,
                                    org.hibernate.service.ServiceRegistry serviceRegistry)
        Overrides:
        contributeTypes in class org.hibernate.dialect.Dialect
      • 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 interface SpatialDialect
        Parameters:
        columnName - The name of the Geometry property
        aggregation - The type of SpatialAggregate
        Returns:
        The SQL fragment for the projection
      • getDWithinSQL

        public String getDWithinSQL​(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:
        The SQL fragment when parsing a DWithinExpression.
      • getHavingSridSQL

        public String getHavingSridSQL​(String columnName)
        Description copied from interface: SpatialDialect
        Returns the SQL fragment when parsing a HavingSridExpression.
        Specified by:
        getHavingSridSQL in interface SpatialDialect
        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 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:
        The SQL fragment for the isempty function
      • getSpatialFilterExpression

        public String getSpatialFilterExpression​(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
        Parameters:
        columnName - The name of the geometry-typed column to which the filter is be applied
        Returns:
        Rhe SQL fragment for the SpatialFilterExpression
      • getSpatialRelateSQL

        public String getSpatialRelateSQL​(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 SpatialRelateExpression
      • 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
        Returns:
        True if filtering is supported
      • 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.