Package io.jmix.core

Class Sort.ExpressionOrder

java.lang.Object
io.jmix.core.Sort.Order
io.jmix.core.Sort.ExpressionOrder
All Implemented Interfaces:
Serializable
Enclosing class:
Sort

public static class Sort.ExpressionOrder extends Sort.Order
Sort order that uses an expression instead of a property.
See Also:
  • Field Details

    • expression

      protected String expression
  • Constructor Details

  • Method Details

    • asc

      public static Sort.Order asc(String expression)
      Creates a new order for the given expression with ASC direction.
    • desc

      public static Sort.Order desc(String expression)
      Creates a new order for the given expression with DESC direction.
    • getExpression

      public String getExpression()
      Returns the expression that should be added to the sorting.

      For instance, for the JPQL it can be "function('calc_total_sum', {E}.id)".

      Note that for KeyValueEntity, the {E} alias is not supported. Use the concrete alias from the query, e.g. "e.id".

      Returns:
      the expression