com.gisgraphy.hibernate.criterion

## Class DistanceOrder

- java.lang.Object
- - org.hibernate.criterion.Order
  - - com.gisgraphy.hibernate.criterion.DistanceOrder

- All Implemented Interfaces:
    Serializable

      public class DistanceOrder
      extends org.hibernate.criterion.Order

  A criteria that sort by distance for better performance you can use `ProjectionOrder` if a projection for distance calculation have been added
  Author:
    David Masclet
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DistanceOrder(com.vividsolutions.jts.geom.Point point)`
    `DistanceOrder(com.vividsolutions.jts.geom.Point point, boolean ascending)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `toSqlString(org.hibernate.Criteria criteria, org.hibernate.criterion.CriteriaQuery criteriaQuery)`

    - ### Methods inherited from class org.hibernate.criterion.Order

      `asc, desc, ignoreCase, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DistanceOrder

          public DistanceOrder(com.vividsolutions.jts.geom.Point point,
                       boolean ascending)

      Parameters:
        `point` - The point from which we calculate the distance
        `ascending` - Whether we sort Ascending

    - #### DistanceOrder

          public DistanceOrder(com.vividsolutions.jts.geom.Point point)

      Parameters:
        `point` - the point from which we calculate the distance, default ascending is true

  - ### Method Detail

    - #### toSqlString

          public String toSqlString(org.hibernate.Criteria criteria,
                           org.hibernate.criterion.CriteriaQuery criteriaQuery)
                             throws org.hibernate.HibernateException

      Overrides:
        `toSqlString` in class `org.hibernate.criterion.Order`
      Throws:
        `org.hibernate.HibernateException`

Copyright © 2015. All rights reserved.