Class MySQL56SpatialDialect

  • All Implemented Interfaces:
    Serializable, ConversionContext, SpatialDialect
    Direct Known Subclasses:
    MySQL56InnoDBSpatialDialect

    public class MySQL56SpatialDialect
    extends 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 Detail

      • MySQL56SpatialDialect

        public MySQL56SpatialDialect()
        Constructs the dialect
    • Method Detail

      • getTypeName

        public String getTypeName​(int code,
                                  long length,
                                  int precision,
                                  int scale)
                           throws HibernateException
        Description copied from class: Dialect
        Get the name of the database type associated with the given Types typecode with the given storage specification parameters.
        Overrides:
        getTypeName in class Dialect
        Parameters:
        code - The Types typecode
        length - The datatype length
        precision - The datatype precision
        scale - The datatype scale
        Returns:
        the database type name
        Throws:
        HibernateException - If no mapping was specified for that type.
      • contributeTypes

        public void contributeTypes​(TypeContributions typeContributions,
                                    ServiceRegistry serviceRegistry)
        Allows the Dialect to contribute additional types
        Overrides:
        contributeTypes in class Dialect
        Parameters:
        typeContributions - Callback to contribute the types
        serviceRegistry - 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 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 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
      • 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
      • 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.