Class RecordQuery
- java.lang.Object
-
- com.apple.foundationdb.record.query.RecordQuery
-
- All Implemented Interfaces:
QueryHashable
@API(STABLE) public class RecordQuery extends Object implements QueryHashable
The logical form of a query. A query mainly consists of:- The names of the record type(s) to query.
- A
QueryComponent
filter. - A sort key.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RecordQuery.Builder
A builder forRecordQuery
.-
Nested classes/interfaces inherited from interface com.apple.foundationdb.record.QueryHashable
QueryHashable.QueryHashKind
-
-
Field Summary
Fields Modifier and Type Field Description static Collection<String>
ALL_TYPES
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<String>
getAllowedIndexes()
QueryComponent
getFilter()
IndexQueryabilityFilter
getIndexQueryabilityFilter()
Collection<String>
getRecordTypes()
List<KeyExpression>
getRequiredResults()
KeyExpression
getSort()
boolean
hasAllowedIndexes()
boolean
isSortReverse()
static RecordQuery.Builder
newBuilder()
int
queryHash(QueryHashable.QueryHashKind hashKind)
Return a hash similar tohashCode
, but with the additional guarantee that is is stable across JVMs.boolean
removesDuplicates()
RecordQuery.Builder
toBuilder()
String
toString()
void
validate(RecordMetaData metaData)
Validates that this record query is valid with the provided metadata.
-
-
-
Field Detail
-
ALL_TYPES
public static final Collection<String> ALL_TYPES
-
-
Method Detail
-
getRecordTypes
@Nonnull public Collection<String> getRecordTypes()
-
hasAllowedIndexes
public boolean hasAllowedIndexes()
-
getAllowedIndexes
@Nullable public Collection<String> getAllowedIndexes()
-
getIndexQueryabilityFilter
@API(EXPERIMENTAL) @Nonnull public IndexQueryabilityFilter getIndexQueryabilityFilter()
-
getFilter
@Nullable public QueryComponent getFilter()
-
getSort
@Nullable public KeyExpression getSort()
-
isSortReverse
public boolean isSortReverse()
-
removesDuplicates
public boolean removesDuplicates()
-
getRequiredResults
@Nullable public List<KeyExpression> getRequiredResults()
-
validate
public void validate(@Nonnull RecordMetaData metaData)
Validates that this record query is valid with the provided metadata.- Parameters:
metaData
- the metadata that you want to use with this query
-
newBuilder
public static RecordQuery.Builder newBuilder()
-
toBuilder
public RecordQuery.Builder toBuilder()
-
queryHash
public int queryHash(@Nonnull QueryHashable.QueryHashKind hashKind)
Description copied from interface:QueryHashable
Return a hash similar tohashCode
, but with the additional guarantee that is is stable across JVMs.- Specified by:
queryHash
in interfaceQueryHashable
- Parameters:
hashKind
- the "kind" of hash to calculate. Each kind of hash has a particular logic with regards to included and excluded items.- Returns:
- a stable hash code
-
-