T
- public class DefaultIdentityQuery<T extends IdentityType> extends Object implements IdentityQuery<T>
Constructor and Description |
---|
DefaultIdentityQuery(IdentityQueryBuilder queryBuilder,
IdentityContext context,
Class<T> identityType,
StoreSelector storeSelector) |
Modifier and Type | Method and Description |
---|---|
Set<Condition> |
getConditions()
Returns a set containing all conditions used by this query to filter its results.
|
Class<T> |
getIdentityType()
The type used to create this query.
|
int |
getLimit()
Returns the number of instances to retrieve.
|
int |
getOffset() |
Object |
getPaginationContext() |
Object[] |
getParameter(QueryParameter queryParameter)
Returns the value used to restrict the given query parameter.
|
Map<QueryParameter,Object[]> |
getParameters()
Returns a map with all the parameter set for this query.
|
Map<QueryParameter,Object[]> |
getParameters(Class<?> type) |
int |
getResultCount()
Count of all query results.
|
List<T> |
getResultList()
Execute the query against the underlying identity stores and returns a list containing all instances of
the type (defined when creating this query instance) that match the conditions previously specified.
|
Set<Sort> |
getSorting()
Returns a set containing all sorting conditions used to filter the results.
|
QueryParameter[] |
getSortParameters() |
boolean |
isSortAscending() |
IdentityQuery<T> |
setLimit(int limit)
Set the maximum number of results to retrieve.
|
IdentityQuery<T> |
setOffset(int offset)
Set the position of the first result to retrieve.
|
IdentityQuery<T> |
setPaginationContext(Object object)
Used for pagination models like LDAP when search will return some object (like cookie) for searching on next page
|
IdentityQuery<T> |
setParameter(QueryParameter queryParameter,
Object... value)
Set a query parameter to this query in order to filter the results.
|
IdentityQuery<T> |
setSortAscending(boolean sortAscending)
Specify if sorting will be ascending (true) or descending (false)
|
IdentityQuery<T> |
setSortParameters(QueryParameter... sortParameters)
Parameters used to sort the results.
|
IdentityQuery<T> |
sortBy(Sort... sorts)
Add to this query the sorting conditions to be applied to the results.
|
IdentityQuery<T> |
where(Condition... condition)
Add to this query the conditions that will be used to filter results.
|
public DefaultIdentityQuery(IdentityQueryBuilder queryBuilder, IdentityContext context, Class<T> identityType, StoreSelector storeSelector)
public IdentityQuery<T> setParameter(QueryParameter queryParameter, Object... value)
IdentityQuery
Set a query parameter to this query in order to filter the results.
This method always create an equality condition. For more conditions options take a look at IdentityQueryBuilder
and use the IdentityQuery.where(Condition...)
instead.
setParameter
in interface IdentityQuery<T extends IdentityType>
queryParameter
- The query parameter.value
- The value to match for equality.public IdentityQuery<T> where(Condition... condition)
IdentityQuery
Add to this query the conditions that will be used to filter results.
Any condition previously added to this query will be preserved and the new conditions added. If you want to clear the conditions you must create a new query instance.
where
in interface IdentityQuery<T extends IdentityType>
condition
- One or more conditions created from IdentityQueryBuilder
.public IdentityQuery<T> sortBy(Sort... sorts)
IdentityQuery
Add to this query the sorting conditions to be applied to the results.
sortBy
in interface IdentityQuery<T extends IdentityType>
sorts
- The ordering conditions.public Set<Sort> getSorting()
IdentityQuery
Returns a set containing all sorting conditions used to filter the results.
getSorting
in interface IdentityQuery<T extends IdentityType>
public Class<T> getIdentityType()
IdentityQuery
The type used to create this query.
getIdentityType
in interface IdentityQuery<T extends IdentityType>
public Map<QueryParameter,Object[]> getParameters()
IdentityQuery
Returns a map with all the parameter set for this query.
getParameters
in interface IdentityQuery<T extends IdentityType>
public Object[] getParameter(QueryParameter queryParameter)
IdentityQuery
Returns the value used to restrict the given query parameter.
getParameter
in interface IdentityQuery<T extends IdentityType>
public Map<QueryParameter,Object[]> getParameters(Class<?> type)
getParameters
in interface IdentityQuery<T extends IdentityType>
public int getLimit()
IdentityQuery
Returns the number of instances to retrieve.
getLimit
in interface IdentityQuery<T extends IdentityType>
public int getOffset()
getOffset
in interface IdentityQuery<T extends IdentityType>
public Object getPaginationContext()
getPaginationContext
in interface IdentityQuery<T extends IdentityType>
IdentityQuery.setPaginationContext(Object object)
public QueryParameter[] getSortParameters()
getSortParameters
in interface IdentityQuery<T extends IdentityType>
IdentityQuery.setSortParameters(QueryParameter...)
public boolean isSortAscending()
isSortAscending
in interface IdentityQuery<T extends IdentityType>
IdentityQuery.setSortAscending(boolean)
public List<T> getResultList()
IdentityQuery
Execute the query against the underlying identity stores and returns a list containing all instances of the type (defined when creating this query instance) that match the conditions previously specified.
getResultList
in interface IdentityQuery<T extends IdentityType>
public int getResultCount()
IdentityQuery
getResultCount
in interface IdentityQuery<T extends IdentityType>
public IdentityQuery<T> setOffset(int offset)
IdentityQuery
Set the position of the first result to retrieve.
setOffset
in interface IdentityQuery<T extends IdentityType>
public IdentityQuery<T> setLimit(int limit)
IdentityQuery
Set the maximum number of results to retrieve.
setLimit
in interface IdentityQuery<T extends IdentityType>
limit
- the number of instances to retrieve.public IdentityQuery<T> setSortParameters(QueryParameter... sortParameters)
IdentityQuery
setSortParameters
in interface IdentityQuery<T extends IdentityType>
sortParameters
- parameters to specify sort criteriapublic IdentityQuery<T> setSortAscending(boolean sortAscending)
IdentityQuery
setSortAscending
in interface IdentityQuery<T extends IdentityType>
sortAscending
- to specify if sorting will be ascending or descendingpublic IdentityQuery<T> setPaginationContext(Object object)
IdentityQuery
setPaginationContext
in interface IdentityQuery<T extends IdentityType>
object
- to be used for search next pagepublic Set<Condition> getConditions()
IdentityQuery
Returns a set containing all conditions used by this query to filter its results.
getConditions
in interface IdentityQuery<T extends IdentityType>
Copyright © 2018 JBoss by Red Hat. All rights reserved.