Package org.keycloak.models.map.storage
Class QueryParameters<M>
java.lang.Object
org.keycloak.models.map.storage.QueryParameters<M>
- Type Parameters:
M
- Provide entity specific type checking, for example, when we createQueryParameters
instance for Users, M is equal to UserModel, hence we are not able, for example, to order result by aSearchableModelField
defined for clients inClientModel
.
Wraps together parameters for querying storage e.g. number of results to return, requested order or filtering criteria
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enum for ascending or descending orderingstatic class
Wrapper class for a field with itsOrder
, ascending or descending -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetLimit()
Sets limit parameterSets offset parameterorderBy
(SearchableModelField<M> searchableModelField, QueryParameters.Order order) Sets orderBy parameter; can be called repeatedly; fields are stored in a list where the first field has highest priority when determining order; e.g.pagination
(Integer offset, Integer limit, SearchableModelField<M> orderByAscField) Sets pagination (offset, limit and orderBy) parameters toQueryParameters
toString()
static <M> QueryParameters<M>
withCriteria
(DefaultModelCriteria<M> mcb) Creates a newQueryParameters
instance initialized withModelCriteriaBuilder
-
Constructor Details
-
QueryParameters
public QueryParameters() -
QueryParameters
-
-
Method Details
-
withCriteria
Creates a newQueryParameters
instance initialized withModelCriteriaBuilder
- Type Parameters:
M
- model type- Parameters:
mcb
- filtering criteria- Returns:
- a new
QueryParameters
instance
-
pagination
public QueryParameters<M> pagination(Integer offset, Integer limit, SearchableModelField<M> orderByAscField) Sets pagination (offset, limit and orderBy) parameters toQueryParameters
- Parameters:
offset
-limit
-orderByAscField
-- Returns:
- this object
-
orderBy
public QueryParameters<M> orderBy(SearchableModelField<M> searchableModelField, QueryParameters.Order order) Sets orderBy parameter; can be called repeatedly; fields are stored in a list where the first field has highest priority when determining order; e.g. the second field is compared only when values for the first field are equal- Parameters:
searchableModelField
-- Returns:
- this object
-
offset
Sets offset parameter- Parameters:
offset
-- Returns:
-
limit
Sets limit parameter- Parameters:
limit
-- Returns:
-
getOffset
-
getLimit
-
getModelCriteriaBuilder
-
getOrderBy
-
toString
-