Interface QueryBuilder<T>
- Type Parameters:
T- type of the DynamoDB entity
- All Superinterfaces:
DetachedQuery<T>
Builder for DynamoDB queries.
-
Method Summary
Modifier and TypeMethodDescriptiondefault QueryBuilder<T>and(groovy.lang.Closure<RangeConditionCollector<T>> conditions) One or more range key filter conditions in conjunction.default QueryBuilder<T>and(Consumer<RangeConditionCollector<T>> conditions) One or more range key filter conditions in conjunction.default QueryBuilder<T>Configures the native query expression.configure(Consumer<com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBQueryExpression<T>> configurer) Configures the native query expression.consistent(com.agorapulse.micronaut.aws.dynamodb.builder.Builders.Read read) Demand consistent reads.filter(com.amazonaws.services.dynamodbv2.model.ConditionalOperator or) Sets the conditional operator for the filter.default QueryBuilder<T>filter(groovy.lang.Closure<RangeConditionCollector<T>> conditions) One or more range key filter conditions.filter(Consumer<RangeConditionCollector<T>> conditions) One or more range key filter conditions.Sets the hash key value for the query.inconsistent(com.agorapulse.micronaut.aws.dynamodb.builder.Builders.Read read) Demand inconsistent reads.Select the index on which this query will be executed.limit(int max) Sets the maximum number of items to be returned from the queries.default QueryBuilder<T>Sets the query offset by defining the exclusive start hash key (hash key of the last entity returned).Sets the query offset by defining the exclusive start hash and range key (hash and range key of the last entity returned).default QueryBuilder<T>Limits which properties of the returned entities will be populated.Limits which properties of the returned entities will be populated.default QueryBuilder<T>Limits which properties of the returned entities will be populated.default QueryBuilder<T>or(groovy.lang.Closure<RangeConditionCollector<T>> conditions) One or more range key filter conditions in disjunction.default QueryBuilder<T>or(Consumer<RangeConditionCollector<T>> conditions) One or more range key filter conditions in disjunction.page(int page) Sets the desired pagination of the queries.default QueryBuilder<T>range(groovy.lang.Closure<RangeConditionCollector<T>> conditions) One or more range key conditions.range(Consumer<RangeConditionCollector<T>> conditions) One or more range key conditions.sort(com.agorapulse.micronaut.aws.dynamodb.builder.Builders.Sort sort) Sort the results by the range indexMethods inherited from interface com.agorapulse.micronaut.aws.dynamodb.builder.DetachedQuery
count, query, resolveExpression
-
Method Details
-
sort
Sort the results by the range index- Parameters:
sort- the sort keyword- Returns:
- self
-
consistent
Demand consistent reads.- Parameters:
read- the read keyword- Returns:
- self
-
inconsistent
Demand inconsistent reads.- Parameters:
read- the read keyword- Returns:
- self
-
index
Select the index on which this query will be executed.- Parameters:
name- the name of the index to be used- Returns:
- self
-
hash
Sets the hash key value for the query. This parameter is required for every query.- Parameters:
key- the hash key of the query or an instance of the object with the hash key set- Returns:
- self
-
range
One or more range key conditions.- Parameters:
conditions- consumer to build the conditions- Returns:
- self
-
range
default QueryBuilder<T> range(@DelegatesTo(type="com.agorapulse.micronaut.aws.dynamodb.builder.RangeConditionCollector<T>",strategy=1) groovy.lang.Closure<RangeConditionCollector<T>> conditions) One or more range key conditions.- Parameters:
conditions- closure to build the conditions- Returns:
- self
-
filter
One or more range key filter conditions. These conditions are resolved on the result set before returning the values and therefore they don't require an existing index but they consume more resources as all the result set must be traversed.- Parameters:
conditions- consumer to build the conditions- Returns:
- self
-
or
One or more range key filter conditions in disjunction.These conditions are resolved on the result set before returning the values and therefore they don't require an existing index but they consume more resources as all the result set must be traversed.
- Parameters:
conditions- consumer to build the conditions- Returns:
- self
-
and
One or more range key filter conditions in conjunction.These conditions are resolved on the result set before returning the values and therefore they don't require an existing index but they consume more resources as all the result set must be traversed.
- Parameters:
conditions- consumer to build the conditions- Returns:
- self
-
filter
default QueryBuilder<T> filter(@DelegatesTo(type="com.agorapulse.micronaut.aws.dynamodb.builder.RangeConditionCollector<T>",strategy=1) groovy.lang.Closure<RangeConditionCollector<T>> conditions) One or more range key filter conditions. These conditions are resolved on the result set before returning the values and therefore they don't require an existing index but they consume more resources as all the result set must be traversed.- Parameters:
conditions- closure to build the conditions- Returns:
- self
-
or
default QueryBuilder<T> or(@DelegatesTo(type="com.agorapulse.micronaut.aws.dynamodb.builder.RangeConditionCollector<T>",strategy=1) groovy.lang.Closure<RangeConditionCollector<T>> conditions) One or more range key filter conditions in disjunction. These conditions are resolved on the result set before returning the values and therefore they don't require an existing index but they consume more resources as all the result set must be traversed.- Parameters:
conditions- closure to build the conditions- Returns:
- self
-
and
default QueryBuilder<T> and(@DelegatesTo(type="com.agorapulse.micronaut.aws.dynamodb.builder.RangeConditionCollector<T>",strategy=1) groovy.lang.Closure<RangeConditionCollector<T>> conditions) One or more range key filter conditions in conjunction. These conditions are resolved on the result set before returning the values and therefore they don't require an existing index but they consume more resources as all the result set must be traversed.- Parameters:
conditions- closure to build the conditions- Returns:
- self
-
filter
Sets the conditional operator for the filter. Default isand- Parameters:
or- the conditional operator, usuallyorto switch to disjunction of filter conditions- Returns:
- self
-
page
Sets the desired pagination of the queries. This only sets the optimal pagination of the queries and does not limit the number of items returned. Useto limit the number results returned from the query.io.reactivex.Flowable#take(long)- Parameters:
page- number of entities loaded by one query request (not a number of total entities returned)- Returns:
- self
-
limit
Sets the maximum number of items to be returned from the queries. This is a shortcut for callingon the result Flowable.io.reactivex.Flowable#take(long)- Parameters:
max- the maximum number of items returned- Returns:
- self
-
offset
Sets the query offset by defining the exclusive start hash and range key (hash and range key of the last entity returned).- Parameters:
exclusiveStartKeyValue- exclusive start key hash valueexclusiveRangeStartKey- exclusive start key range value- Returns:
- self
-
offset
Sets the query offset by defining the exclusive start hash key (hash key of the last entity returned).- Parameters:
exclusiveStartKeyValue- exclusive start key hash value- Returns:
- self
-
configure
QueryBuilder<T> configure(Consumer<com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBQueryExpression<T>> configurer) Configures the native query expression. This method is an extension point which allows to configure properties which are not provides by this builder.- Parameters:
configurer- consumer to configure the native query expression- Returns:
- self
-
configure
default QueryBuilder<T> configure(@DelegatesTo(type="com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBQueryExpression<T>",strategy=1) groovy.lang.Closure<Object> configurer) Configures the native query expression. This method is an extension point which allows to configure properties which are not provides by this builder.- Parameters:
configurer- closure to configure the native query expression- Returns:
- self
-
only
Limits which properties of the returned entities will be populated.- Parameters:
propertyPaths- property paths to be populated in the returned entities- Returns:
- self
-
only
Limits which properties of the returned entities will be populated.- Parameters:
propertyPaths- property paths to be populated in the returned entities- Returns:
- self
-
only
default QueryBuilder<T> only(@DelegatesTo(type="T",strategy=3) groovy.lang.Closure<Object> collector) Limits which properties of the returned entities will be populated.- Parameters:
collector- closure to collect the property paths- Returns:
- self
-