org.hibernate.spatial.criterion
Class SpatialFilter

java.lang.Object
  extended by org.hibernate.spatial.criterion.SpatialFilter
All Implemented Interfaces:
java.io.Serializable, org.hibernate.criterion.Criterion

public class SpatialFilter
extends java.lang.Object
implements org.hibernate.criterion.Criterion

An implementation for a simple spatial filter. This Criterion restricts the resultset to those features whose bounding box overlaps the filter geometry. It is intended for quick, but inexact spatial queries.

See Also:
Serialized Form

Constructor Summary
SpatialFilter(java.lang.String propertyName, com.vividsolutions.jts.geom.Envelope envelope, int SRID)
           
SpatialFilter(java.lang.String propertyName, com.vividsolutions.jts.geom.Geometry filter)
           
 
Method Summary
 org.hibernate.engine.spi.TypedValue[] getTypedValues(org.hibernate.Criteria criteria, org.hibernate.criterion.CriteriaQuery criteriaQuery)
          Return typed values for all parameters in the rendered SQL fragment
 java.lang.String toSqlString(org.hibernate.Criteria criteria, org.hibernate.criterion.CriteriaQuery criteriaQuery)
          Render the SQL fragment
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpatialFilter

public SpatialFilter(java.lang.String propertyName,
                     com.vividsolutions.jts.geom.Geometry filter)

SpatialFilter

public SpatialFilter(java.lang.String propertyName,
                     com.vividsolutions.jts.geom.Envelope envelope,
                     int SRID)
Method Detail

getTypedValues

public org.hibernate.engine.spi.TypedValue[] getTypedValues(org.hibernate.Criteria criteria,
                                                            org.hibernate.criterion.CriteriaQuery criteriaQuery)
                                                     throws org.hibernate.HibernateException
Description copied from interface: org.hibernate.criterion.Criterion
Return typed values for all parameters in the rendered SQL fragment

Specified by:
getTypedValues in interface org.hibernate.criterion.Criterion
Parameters:
criteria - The local criteria
criteriaQuery - The overal criteria query
Returns:
The types values (for binding)
Throws:
org.hibernate.HibernateException - Problem determining types.

toSqlString

public java.lang.String toSqlString(org.hibernate.Criteria criteria,
                                    org.hibernate.criterion.CriteriaQuery criteriaQuery)
                             throws org.hibernate.HibernateException
Description copied from interface: org.hibernate.criterion.Criterion
Render the SQL fragment

Specified by:
toSqlString in interface org.hibernate.criterion.Criterion
Parameters:
criteria - The local criteria
criteriaQuery - The overal criteria query
Returns:
The generated SQL fragment
Throws:
org.hibernate.HibernateException - Problem during rendering.