Class KeyValueQuery<T>
java.lang.Object
org.springframework.data.keyvalue.core.query.KeyValueQuery<T>
- Type Parameters:
T- Criteria type
- Author:
- Christoph Strobl, Mark Paluch, Marcel Overdijk
-
Constructor Summary
ConstructorsConstructorDescriptionCreates new instance ofKeyValueQuery.KeyValueQuery(org.springframework.data.domain.Sort sort) Creates new instance ofKeyValueQuerywith givenSort.KeyValueQuery(T criteria) Creates new instance ofKeyValueQuerywith given criteria.KeyValueQuery(T criteria, org.springframework.data.domain.Sort sort) Creates new instance ofKeyValueQuerywith given criteria andSort. -
Method Summary
Modifier and TypeMethodDescriptionGet the criteria object.longNumber of elements to skip.intgetRows()Number of elements to read.org.springframework.data.domain.SortgetSort()GetSort.limit(int rows) orderBy(org.springframework.data.domain.Sort sort) Add givenSort.voidsetOffset(long offset) Set the number of elements to skip.voidsetRows(int rows) Set the number of elements to read.voidsetSort(org.springframework.data.domain.Sort sort) SetSortto be applied.skip(long offset)
-
Constructor Details
-
KeyValueQuery
public KeyValueQuery()Creates new instance ofKeyValueQuery. -
KeyValueQuery
Creates new instance ofKeyValueQuerywith given criteria.- Parameters:
criteria- can be null.
-
KeyValueQuery
Creates new instance ofKeyValueQuerywith given criteria andSort.- Parameters:
criteria- can be null.sort- must not be null.- Since:
- 2.4
-
KeyValueQuery
public KeyValueQuery(org.springframework.data.domain.Sort sort) Creates new instance ofKeyValueQuerywith givenSort.- Parameters:
sort- must not be null.
-
-
Method Details
-
getCriteria
Get the criteria object.- Returns:
- Since:
- 2.0
-
getSort
public org.springframework.data.domain.Sort getSort()GetSort.- Returns:
-
getOffset
public long getOffset()Number of elements to skip.- Returns:
- negative value if not set.
-
getRows
public int getRows()Number of elements to read.- Returns:
- negative value if not set.
-
setOffset
public void setOffset(long offset) Set the number of elements to skip.- Parameters:
offset- use negative value for none.
-
setRows
public void setRows(int rows) Set the number of elements to read.- Parameters:
rows- use negative value for all.
-
setSort
public void setSort(org.springframework.data.domain.Sort sort) SetSortto be applied.- Parameters:
sort-
-
orderBy
Add givenSort.- Parameters:
sort- must not be null.- Returns:
-
skip
- Parameters:
offset-- Returns:
- See Also:
-
limit
- Parameters:
rows-- Returns:
- See Also:
-