Class RelationQuery

java.lang.Object
de.hybris.platform.servicelayer.search.RelationQuery

public class RelationQuery extends Object
The Class RelationQuery specifies one or more ordering criteria with which the paginated search results should be returned (see DevNet "Improve API for Collection attributes")
  • Constructor Details

    • RelationQuery

      public RelationQuery(int start, int count) throws RelationQueryException
      Parameters:
      start - The paginating data -1 means ignore
      count - The paginating data -1 means ignore
      Throws:
      RelationQueryException
    • RelationQuery

      public RelationQuery(ItemModel model, String attribute, int start, int count)
      Creates RelationQuery object with model, attribute, start and count parameters set.
      Parameters:
      model - The model to search for
      attribute - The attribute to search for
      start - The paginating data -1 means ignore
      count - The paginating data -1 means ignore
  • Method Details

    • getStart

      public int getStart()
      For paginating, returns the start index.
    • setStart

      public void setStart(int start)
      For paginating, specify the start index that we want.
      Parameters:
      start - the new start
    • getCount

      public int getCount()
      For paginating, returns the number of results to fetch.
    • getModel

      public ItemModel getModel()
      Gets the model for which we would like to search.
      Returns:
      the model
    • setModel

      public void setModel(ItemModel model)
      Sets the model for which we would like to search.
      Parameters:
      model - the new model
    • getAttribute

      public String getAttribute()
      Gets the attribute we are searching for.
    • setAttribute

      public void setAttribute(String attribute)
      Sets the attribute we would like to search for.
    • addOrder

      public void addOrder(String attribute, RelationQuery.ORDERING ascending) throws RelationQueryException
      Adds the order.
      Parameters:
      attribute - the attribute
      ascending - the ascending
      Throws:
      RelationQueryException
    • getOrderSpec

      public RelationQuery.OrderSpec getOrderSpec(int number)
      Returns search order.
    • getOrderCount

      public int getOrderCount()
      Returns count of orderSpec attributes.