Class Order

java.lang.Object
com.jbstrap.core.dao.Order

public class Order extends Object

POJO class for ordering

With this class, ordering conditions can be described and used for queries. This class can be used for direct queries, and with data handling components

Since:
4.0
Author:
JBStrap
  • Constructor Details

    • Order

      public Order(String columnName)
      Creates an Order, that will sort in ascending order
      Parameters:
      columnName - The name of the column, which will be used as a base for the ascending ordering
      Throws:
      NullPointerException - If the columnName is null
    • Order

      public Order(String columnName, OrderType type)
      Creates an Order, with the specified ordering type
      Parameters:
      columnName - The name of the column, which will be used as a base for the ordering
      type - The ordering type. This can be specified by using OrderType enum value. If null it will order in an ascending order.
      Throws:
      NullPointerException - If the columnName is null
  • Method Details

    • getColumnName

      public String getColumnName()
      Gets the column name, that is used for ordering
      Returns:
      The column name
    • getOrderType

      public OrderType getOrderType()
      Gets the ordering type
      Returns:
      The ordering type
    • setOrderType

      public Order setOrderType(OrderType type)
      Sets the order type
      Parameters:
      type - The new ordering type. If specified as null, it will sort in an ascending order
      Returns:
      The Order POJO class
    • toString

      public String toString()

      Returns a String representation of the Order POJO class

      This String representation contains the column name and the ordering type

      Overrides:
      toString in class Object