Class RelationQuery
- java.lang.Object
-
- de.hybris.platform.servicelayer.search.RelationQuery
-
public class RelationQuery extends java.lang.ObjectThe 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 Classes Modifier and Type Class Description static classRelationQuery.ORDERINGSpecify whether an ordering should be ascending or descendingclassRelationQuery.OrderSpecThe Class OrderSpec.
-
Constructor Summary
Constructors Constructor Description RelationQuery(int start, int count)RelationQuery(ItemModel model, java.lang.String attribute, int start, int count)CreatesRelationQueryobject with model, attribute, start and count parameters set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOrder(java.lang.String attribute, RelationQuery.ORDERING ascending)Adds the order.java.lang.StringgetAttribute()Gets the attribute we are searching for.intgetCount()For paginating, returns the number of results to fetch.ItemModelgetModel()Gets the model for which we would like to search.intgetOrderCount()Returns count of orderSpec attributes.RelationQuery.OrderSpecgetOrderSpec(int number)Returns search order.intgetStart()For paginating, returns the start index.voidsetAttribute(java.lang.String attribute)Sets the attribute we would like to search for.voidsetModel(ItemModel model)Sets the model for which we would like to search.voidsetStart(int start)For paginating, specify the start index that we want.
-
-
-
Constructor Detail
-
RelationQuery
public RelationQuery(int start, int count) throws RelationQueryException- Parameters:
start- The paginating data -1 means ignorecount- The paginating data -1 means ignore- Throws:
RelationQueryException
-
RelationQuery
public RelationQuery(ItemModel model, java.lang.String attribute, int start, int count)
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 Detail
-
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 java.lang.String getAttribute()
Gets the attribute we are searching for.
-
setAttribute
public void setAttribute(java.lang.String attribute)
Sets the attribute we would like to search for.
-
addOrder
public void addOrder(java.lang.String attribute, RelationQuery.ORDERING ascending) throws RelationQueryExceptionAdds the order.- Parameters:
attribute- the attributeascending- the ascending- Throws:
RelationQueryException
-
getOrderSpec
public RelationQuery.OrderSpec getOrderSpec(int number)
Returns search order.
-
getOrderCount
public int getOrderCount()
Returns count of orderSpec attributes.
-
-