Interface Sort

All Superinterfaces:
Prototype.Api
All Known Implementing Classes:
Sort.BuilderBase.SortImpl

public interface Sort extends Prototype.Api
Dynamic ordering of the query result.

Sort class represents the whole List of query ordering rules. E.g. in JPQL query SELECT t FROM Type t WHERE t.name = :name ORDER BY t.name DESC, t.id this is the whole content of the ORDER BY clause.

See Also:
  • Method Details

    • builder

      static Sort.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static Sort.Builder builder(Sort instance)
      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static Sort create()
      Create a new instance with default values.
      Returns:
      a new instance
    • unsorted

      static Sort unsorted()
      Create new instance of query result ordering with no ordering set.
      Returns:
      new query result ordering instance
    • create

      static Sort create(Order... orders)
      Create new instance of query result ordering.
      Parameters:
      orders - order definitions
      Returns:
      new query result ordering instance
    • create

      static Sort create(List<Order> orders)
      Create new instance of query result ordering.
      Parameters:
      orders - List of order definitions
      Returns:
      new query result ordering instance
    • orderBy

      List<Order> orderBy()
      List of query ordering rules. Default value is an empty List to return unordered result.
      Returns:
      List of order definitions
    • isSorted

      default boolean isSorted()
      Whether any order definitions are set.
      Returns:
      value of true when at least one order definition is set or false otherwise