public abstract class EntityQuery<T> extends Object implements Query<T>
Modifier and Type | Field and Description |
---|---|
static int |
ALL_RESULTS
Flag to indicate that an EntityQuery should retrieve all results.
|
static int |
MAX_MAX_RESULTS
This is the recommended maximum number of 'max' results the system will allow you to return.
|
Constructor and Description |
---|
EntityQuery(Class<T> returnType,
EntityDescriptor entityDescriptor,
SearchRestriction searchRestriction,
int startIndex,
int maxResults) |
EntityQuery(EntityQuery<T> query,
int startIndex,
int maxResults) |
EntityQuery(EntityQuery query,
Class<T> returnType) |
Modifier and Type | Method and Description |
---|---|
EntityQuery<T> |
addToMaxResults(int add) |
static int |
addToMaxResults(int maxResults,
int add)
Simple utility method that increases or decreases the result limit and deals with
ALL_RESULTS ,
overflow and prevents negative values. |
static long |
allResultsToLongMax(int maxResults)
Converts max results limit to long value - replaces
ALL_RESULTS with Long.MAX_VALUE }. |
EntityQuery<T> |
baseSplitQuery() |
boolean |
equals(Object o) |
EntityDescriptor |
getEntityDescriptor() |
int |
getMaxResults()
The maximum number of elements to return.
|
Class<T> |
getReturnType()
The type of elements to return.
|
SearchRestriction |
getSearchRestriction()
Restrictions to apply to the query.
|
int |
getStartIndex()
The index of the first element to return.
|
boolean |
hasAllResults() |
int |
hashCode() |
Optional<List<EntityQuery<T>>> |
splitOrRestrictionIfNeeded(int maxSize)
Splits the query if needed.
|
String |
toString() |
EntityQuery<T> |
withAllResults() |
EntityQuery<T> |
withMaxResults(int maxResults) |
<Q> EntityQuery<Q> |
withReturnType(Class<Q> returnType) |
EntityQuery<T> |
withSearchRestriction(SearchRestriction searchRestriction) |
EntityQuery<T> |
withStartIndex(int startIndex) |
EntityQuery<T> |
withStartIndexAndMaxResults(int startIndex,
int maxResults) |
public static final int MAX_MAX_RESULTS
public static final int ALL_RESULTS
WARNING: using this flag could retrieve thousands or millions of entities. Misuse can cause massive performance problems. This flag should only ever be used in exceptional circumstances.
If you need to find "all" entities, then consider making multiple successive calls to Crowd to receive partial results. That way, the entire result set is never stored in memory on the Crowd server at any one time.
public EntityQuery(Class<T> returnType, EntityDescriptor entityDescriptor, SearchRestriction searchRestriction, int startIndex, int maxResults)
public EntityQuery(EntityQuery query, Class<T> returnType)
public EntityQuery(EntityQuery<T> query, int startIndex, int maxResults)
public EntityDescriptor getEntityDescriptor()
public SearchRestriction getSearchRestriction()
Query
getSearchRestriction
in interface Query<T>
public int getStartIndex()
Query
getStartIndex
in interface Query<T>
public int getMaxResults()
Query
getMaxResults
in interface Query<T>
public Class<T> getReturnType()
Query
getReturnType
in interface Query<T>
public static int addToMaxResults(int maxResults, int add)
ALL_RESULTS
,
overflow and prevents negative values.public static long allResultsToLongMax(int maxResults)
ALL_RESULTS
with Long.MAX_VALUE
}.public <Q> EntityQuery<Q> withReturnType(Class<Q> returnType)
public EntityQuery<T> withStartIndex(int startIndex)
public EntityQuery<T> withMaxResults(int maxResults)
public EntityQuery<T> withStartIndexAndMaxResults(int startIndex, int maxResults)
public EntityQuery<T> withSearchRestriction(SearchRestriction searchRestriction)
public EntityQuery<T> baseSplitQuery()
public Optional<List<EntityQuery<T>>> splitOrRestrictionIfNeeded(int maxSize)
maxSize
.
Only top level condition split is supported. Note that the start index and max conditions are adjusted.Optional#empty
otherwisepublic EntityQuery<T> withAllResults()
public EntityQuery<T> addToMaxResults(int add)
public boolean hasAllResults()
Copyright © 2024 Atlassian. All rights reserved.