Class RelationQuery
java.lang.Object
de.hybris.platform.servicelayer.search.RelationQuery
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")
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSpecify whether an ordering should be ascending or descendingclassThe Class OrderSpec. -
Constructor Summary
ConstructorsConstructorDescriptionRelationQuery(int start, int count) RelationQuery(ItemModel model, String attribute, int start, int count) CreatesRelationQueryobject with model, attribute, start and count parameters set. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOrder(String attribute, RelationQuery.ORDERING ascending) Adds the order.Gets the attribute we are searching for.intgetCount()For paginating, returns the number of results to fetch.getModel()Gets the model for which we would like to search.intReturns count of orderSpec attributes.getOrderSpec(int number) Returns search order.intgetStart()For paginating, returns the start index.voidsetAttribute(String attribute) Sets the attribute we would like to search for.voidSets the model for which we would like to search.voidsetStart(int start) For paginating, specify the start index that we want.
-
Constructor Details
-
RelationQuery
- Parameters:
start- The paginating data -1 means ignorecount- The paginating data -1 means ignore- Throws:
RelationQueryException
-
RelationQuery
CreatesRelationQueryobject with model, attribute, start and count parameters set.- Parameters:
model- The model to search forattribute- The attribute to search forstart- The paginating data -1 means ignorecount- 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
Gets the model for which we would like to search.- Returns:
- the model
-
setModel
Sets the model for which we would like to search.- Parameters:
model- the new model
-
getAttribute
Gets the attribute we are searching for. -
setAttribute
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 attributeascending- the ascending- Throws:
RelationQueryException
-
getOrderSpec
Returns search order. -
getOrderCount
public int getOrderCount()Returns count of orderSpec attributes.
-