Interface Order

All Superinterfaces:
Prototype.Api
All Known Implementing Classes:
Order.BuilderBase.OrderImpl

public interface Order extends Prototype.Api
Single rule of the dynamic ordering of the query result.

Order class is the single item of the List stored in Sort. It represents single ordering rule. E.g. in JPQL query SELECT t FROM Type t WHERE t.name = :name ORDER BY t.name DESC, t.id this is the t.name DESC and t.id as two separate Order instances.

See Also:
  • Field Details

    • UNSORTED

      static final Order[] UNSORTED
      Query result ordering with no rules set (unsorted).
  • Method Details

    • builder

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

      static Order.Builder builder(Order 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 Order create()
      Create a new instance with default values.
      Returns:
      a new instance
    • create

      static Order create(String property)
      Create new instance of order definition with default direction and case-sensitivity. Default direction is OrderDirection.ASC and default value of caseSensitive() is true.
      Parameters:
      property - entity property
      Returns:
      new order definition instance
    • create

      static Order create(String property, OrderDirection direction)
      Create new instance of order definition with default case-sensitivity. Default value of caseSensitive() is true.
      Parameters:
      property - entity property
      direction - direction of the ordering
      Returns:
      new order definition instance
    • create

      static Order create(String property, OrderDirection direction, boolean caseSensitive)
      Create new instance of order definition.
      Parameters:
      property - entity property
      direction - direction of the ordering
      caseSensitive - value of true for case-sensitive or false for case-sensitive ordering
      Returns:
      new order definition instance
    • property

      String property()
      Entity property used for ordering.

      E.g. this is the path expression in Jakarta Persistence API. In following JPQL query: SELECT t FROM Type t WHERE t.name = :name ORDER BY t.name the entity property is the t.name path expression after ORDER BY keyword.

      Returns:
      entity property
    • direction

      OrderDirection direction()
      Direction of the ordering. Default value is OrderDirection.ASC.
      Returns:
      direction of the ordering
    • caseSensitive

      boolean caseSensitive()
      Whether ordering is case-sensitive. Default value is true.
      Returns:
      value of true when ordering is case-sensitive or false otherwise