Interface CpoOrderBy

All Known Implementing Classes:
BindableCpoOrderBy

public interface CpoOrderBy
CpoOrderBy is an interface for specifying the sort order in which objects are returned from the Datasource.
Author:
david berry
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Default marker string searched for and replaced by the generated order-by expression.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Gets the boolean that determines if the objects will be returned from from the CpoAdapter in Ascending order or Descending order
    Gets the name of the attribute that is to be used to sort the results from the CpoAdapter.
    Gets a string representing a datasource specific function call that must be applied to the attribute that will be used for sorting.
    Gets the string marker that this cpoOrderBy will search for in the expression to replace
    toString(CpoClass cpoClass)
    Builds the native (SQL/CQL) order-by fragment for this clause against the given class's attribute-to-column mapping.
  • Field Details

    • DEFAULT_MARKER

      static final String DEFAULT_MARKER
      Default marker string searched for and replaced by the generated order-by expression.
      See Also:
  • Method Details

    • getAscending

      boolean getAscending()
      Gets the boolean that determines if the objects will be returned from from the CpoAdapter in Ascending order or Descending order
      Returns:
      boolean true if it is to sort in Ascensing Order false if it is to be sorted in Descending Order
    • getAttribute

      String getAttribute()
      Gets the name of the attribute that is to be used to sort the results from the CpoAdapter.
      Returns:
      String The name of the attribute
    • getFunction

      String getFunction()
      Gets a string representing a datasource specific function call that must be applied to the attribute that will be used for sorting.

      i.e. - "upper(attribute_name)"

      Returns:
      String The name of the function
    • getMarker

      String getMarker()
      Gets the string marker that this cpoOrderBy will search for in the expression to replace
      Returns:
      String The marker of the CpoOrderBy
    • toString

      String toString(CpoClass cpoClass) throws CpoException
      Builds the native (SQL/CQL) order-by fragment for this clause against the given class's attribute-to-column mapping.
      Parameters:
      cpoClass - the class metadata used to resolve the attribute to a datastore column
      Returns:
      the string that will be added into the expression
      Throws:
      CpoException - if the attribute cannot be resolved against cpoClass