Class Order

  • All Implemented Interfaces:
    java.io.Serializable

    public class Order
    extends java.lang.Object
    implements java.io.Serializable
    Represents an ordering imposed upon the results of a Criteria
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Order​(java.lang.String propertyName, boolean ascending)
      Constructor for Order.
    • Constructor Detail

      • Order

        protected Order​(java.lang.String propertyName,
                        boolean ascending)
        Constructor for Order. Order instances are generally created by factory methods.
        See Also:
        asc(java.lang.String), desc(java.lang.String)
    • Method Detail

      • asc

        public static Order asc​(java.lang.String propertyName)
        Ascending order
        Parameters:
        propertyName - The property to order on
        Returns:
        The build Order instance
      • desc

        public static Order desc​(java.lang.String propertyName)
        Descending order.
        Parameters:
        propertyName - The property to order on
        Returns:
        The build Order instance
      • ignoreCase

        public Order ignoreCase()
        Should this ordering ignore case? Has no effect on non-character properties.
        Returns:
        this, for method chaining
      • nulls

        public Order nulls​(NullPrecedence nullPrecedence)
        Defines precedence for nulls.
        Parameters:
        nullPrecedence - The null precedence to use
        Returns:
        this, for method chaining
      • getPropertyName

        public java.lang.String getPropertyName()
      • isAscending

        public boolean isAscending()
      • isIgnoreCase

        public boolean isIgnoreCase()
      • toSqlString

        public java.lang.String toSqlString​(Criteria criteria,
                                            CriteriaQuery criteriaQuery)
        Render the SQL fragment
        Parameters:
        criteria - The criteria
        criteriaQuery - The overall query
        Returns:
        The ORDER BY fragment for this ordering
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object