Class PostgisSupport

  • All Implemented Interfaces:
    java.io.Serializable, SpatialDialect

    public class PostgisSupport
    extends java.lang.Object
    implements SpatialDialect, java.io.Serializable
    Created by Karel Maesen, Geovise BVBA on 29/10/16.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      PostgisSupport()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.hibernate.spatial.dialect.postgis.PostgisFunctions functionsToRegister()  
      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 a 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)
      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 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.
      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 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PostgisSupport

        public PostgisSupport()
    • Method Detail

      • functionsToRegister

        public org.hibernate.spatial.dialect.postgis.PostgisFunctions functionsToRegister()
      • getSpatialRelateSQL

        public 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.

        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
      • getSpatialFilterExpression

        public 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.
        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
      • 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 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)
        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 java.lang.String getHavingSridSQL​(java.lang.String columnName)
        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 java.lang.String getIsEmptySQL​(java.lang.String columnName,
                                              boolean isEmpty)
        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
      • supportsFiltering

        public boolean supportsFiltering()
        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)
        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.