Class AbstractDynamoDBQueryCriteria<T,ID>
- java.lang.Object
-
- org.socialsignin.spring.data.dynamodb.repository.query.AbstractDynamoDBQueryCriteria<T,ID>
-
- All Implemented Interfaces:
DynamoDBQueryCriteria<T,ID>,SortHandler
- Direct Known Subclasses:
DynamoDBEntityWithHashAndRangeKeyCriteria,DynamoDBEntityWithHashKeyOnlyCriteria
public abstract class AbstractDynamoDBQueryCriteria<T,ID> extends java.lang.Object implements DynamoDBQueryCriteria<T,ID>, SortHandler
- Author:
- Michael Lavelle, Sebastian Just
-
-
Field Summary
Fields Modifier and Type Field Description protected org.springframework.util.MultiValueMap<java.lang.String,com.amazonaws.services.dynamodbv2.model.Condition>attributeConditionsprotected java.lang.Class<T>clazzprotected java.lang.StringglobalSecondaryIndexNameprotected java.lang.ObjecthashKeyAttributeValueprotected java.lang.ObjecthashKeyPropertyValueprotected java.util.Optional<java.lang.Integer>limitprotected java.util.Optional<java.lang.String>projectionprotected org.springframework.util.MultiValueMap<java.lang.String,com.amazonaws.services.dynamodbv2.model.Condition>propertyConditionsprotected org.springframework.data.domain.Sortsort
-
Constructor Summary
Constructors Constructor Description AbstractDynamoDBQueryCriteria(DynamoDBEntityInformation<T,ID> dynamoDBEntityInformation, com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperTableModel<T> tableModel)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected <P> java.util.List<com.amazonaws.services.dynamodbv2.model.AttributeValue>addAttributeValue(java.util.List<com.amazonaws.services.dynamodbv2.model.AttributeValue> attributeValueList, java.lang.Object attributeValue, java.lang.Class<P> propertyType, boolean expandCollectionValues)protected voidapplySortIfSpecified(com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBQueryExpression<T> queryExpression, java.util.List<java.lang.String> permittedPropertyNames)protected voidapplySortIfSpecified(com.amazonaws.services.dynamodbv2.model.QueryRequest queryRequest, java.util.List<java.lang.String> permittedPropertyNames)Query<java.lang.Long>buildCountQuery(DynamoDBOperations dynamoDBOperations, boolean pageQuery)protected abstract Query<java.lang.Long>buildFinderCountQuery(DynamoDBOperations dynamoDBOperations, boolean pageQuery)protected abstract Query<T>buildFinderQuery(DynamoDBOperations dynamoDBOperations)Query<T>buildQuery(DynamoDBOperations dynamoDBOperations)protected com.amazonaws.services.dynamodbv2.model.QueryRequestbuildQueryRequest(java.lang.String tableName, java.lang.String theIndexName, java.lang.String hashKeyAttributeName, java.lang.String rangeKeyAttributeName, java.lang.String rangeKeyPropertyName, java.util.List<com.amazonaws.services.dynamodbv2.model.Condition> hashKeyConditions, java.util.List<com.amazonaws.services.dynamodbv2.model.Condition> rangeKeyConditions)protected abstract Query<java.lang.Long>buildSingleEntityCountQuery(DynamoDBOperations dynamoDBOperations)protected abstract Query<T>buildSingleEntityLoadQuery(DynamoDBOperations dynamoDBOperations)booleancomparisonOperatorsPermittedForQuery()protected com.amazonaws.services.dynamodbv2.model.ConditioncreateCollectionCondition(java.lang.String propertyName, com.amazonaws.services.dynamodbv2.model.ComparisonOperator comparisonOperator, java.lang.Iterable<?> o, java.lang.Class<?> propertyType)protected <V> com.amazonaws.services.dynamodbv2.model.ConditioncreateNoValueCondition(java.lang.String propertyName, com.amazonaws.services.dynamodbv2.model.ComparisonOperator comparisonOperator)protected com.amazonaws.services.dynamodbv2.model.ConditioncreateSingleValueCondition(java.lang.String propertyName, com.amazonaws.services.dynamodbv2.model.ComparisonOperator comparisonOperator, java.lang.Object o, java.lang.Class<?> propertyType, boolean alreadyMarshalledIfRequired)protected java.lang.StringgetAttributeName(java.lang.String propertyName)protected java.lang.StringgetGlobalSecondaryIndexName()protected java.lang.StringgetHashKeyAttributeName()java.lang.ObjectgetHashKeyAttributeValue()protected java.util.List<com.amazonaws.services.dynamodbv2.model.Condition>getHashKeyConditions()protected java.lang.StringgetHashKeyPropertyName()java.lang.ObjectgetHashKeyPropertyValue()protected <V> java.lang.ObjectgetPropertyAttributeValue(java.lang.String propertyName, V value)protected booleanhasIndexHashKeyEqualCondition()protected booleanhasIndexRangeKeyCondition()protected booleanisApplicableForGlobalSecondaryIndex()abstract booleanisApplicableForLoad()protected booleanisHashKeyProperty(java.lang.String propertyName)booleanisHashKeySpecified()protected abstract booleanisOnlyHashKeySpecified()DynamoDBQueryCriteria<T,ID>withCondition(java.lang.String propertyName, com.amazonaws.services.dynamodbv2.model.Condition condition)DynamoDBQueryCriteria<T,ID>withHashKeyEquals(java.lang.Object value)DynamoDBQueryCriteria<T,ID>withLimit(java.util.Optional<java.lang.Integer> limit)DynamoDBQueryCriteria<T,ID>withNoValuedCriteria(java.lang.String propertyName, com.amazonaws.services.dynamodbv2.model.ComparisonOperator comparisonOperator)DynamoDBQueryCriteria<T,ID>withProjection(java.util.Optional<java.lang.String> projection)DynamoDBQueryCriteria<T,ID>withPropertyBetween(java.lang.String propertyName, java.lang.Object value1, java.lang.Object value2, java.lang.Class<?> type)DynamoDBQueryCriteria<T,ID>withPropertyIn(java.lang.String propertyName, java.lang.Iterable<?> value, java.lang.Class<?> propertyType)DynamoDBQueryCriteria<T,ID>withSingleValueCriteria(java.lang.String propertyName, com.amazonaws.services.dynamodbv2.model.ComparisonOperator comparisonOperator, java.lang.Object value, java.lang.Class<?> propertyType)DynamoDBQueryCriteria<T,ID>withSort(org.springframework.data.domain.Sort sort)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.socialsignin.spring.data.dynamodb.repository.query.DynamoDBQueryCriteria
withPropertyEquals
-
Methods inherited from interface org.socialsignin.spring.data.dynamodb.utils.SortHandler
ensureNoSort, ensureNoSort, throwUnsupportedSortOperationException
-
-
-
-
Field Detail
-
clazz
protected java.lang.Class<T> clazz
-
attributeConditions
protected org.springframework.util.MultiValueMap<java.lang.String,com.amazonaws.services.dynamodbv2.model.Condition> attributeConditions
-
propertyConditions
protected org.springframework.util.MultiValueMap<java.lang.String,com.amazonaws.services.dynamodbv2.model.Condition> propertyConditions
-
hashKeyAttributeValue
protected java.lang.Object hashKeyAttributeValue
-
hashKeyPropertyValue
protected java.lang.Object hashKeyPropertyValue
-
globalSecondaryIndexName
protected java.lang.String globalSecondaryIndexName
-
sort
protected org.springframework.data.domain.Sort sort
-
projection
protected java.util.Optional<java.lang.String> projection
-
limit
protected java.util.Optional<java.lang.Integer> limit
-
-
Constructor Detail
-
AbstractDynamoDBQueryCriteria
public AbstractDynamoDBQueryCriteria(DynamoDBEntityInformation<T,ID> dynamoDBEntityInformation, com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperTableModel<T> tableModel)
-
-
Method Detail
-
isApplicableForLoad
public abstract boolean isApplicableForLoad()
-
buildQueryRequest
protected com.amazonaws.services.dynamodbv2.model.QueryRequest buildQueryRequest(java.lang.String tableName, java.lang.String theIndexName, java.lang.String hashKeyAttributeName, java.lang.String rangeKeyAttributeName, java.lang.String rangeKeyPropertyName, java.util.List<com.amazonaws.services.dynamodbv2.model.Condition> hashKeyConditions, java.util.List<com.amazonaws.services.dynamodbv2.model.Condition> rangeKeyConditions)
-
applySortIfSpecified
protected void applySortIfSpecified(com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBQueryExpression<T> queryExpression, java.util.List<java.lang.String> permittedPropertyNames)
-
applySortIfSpecified
protected void applySortIfSpecified(com.amazonaws.services.dynamodbv2.model.QueryRequest queryRequest, java.util.List<java.lang.String> permittedPropertyNames)
-
comparisonOperatorsPermittedForQuery
public boolean comparisonOperatorsPermittedForQuery()
-
getHashKeyConditions
protected java.util.List<com.amazonaws.services.dynamodbv2.model.Condition> getHashKeyConditions()
-
getGlobalSecondaryIndexName
protected java.lang.String getGlobalSecondaryIndexName()
-
isHashKeyProperty
protected boolean isHashKeyProperty(java.lang.String propertyName)
-
getHashKeyPropertyName
protected java.lang.String getHashKeyPropertyName()
-
getHashKeyAttributeName
protected java.lang.String getHashKeyAttributeName()
-
hasIndexHashKeyEqualCondition
protected boolean hasIndexHashKeyEqualCondition()
-
hasIndexRangeKeyCondition
protected boolean hasIndexRangeKeyCondition()
-
isApplicableForGlobalSecondaryIndex
protected boolean isApplicableForGlobalSecondaryIndex()
-
withHashKeyEquals
public DynamoDBQueryCriteria<T,ID> withHashKeyEquals(java.lang.Object value)
-
isHashKeySpecified
public boolean isHashKeySpecified()
-
getHashKeyAttributeValue
public java.lang.Object getHashKeyAttributeValue()
-
getHashKeyPropertyValue
public java.lang.Object getHashKeyPropertyValue()
-
getAttributeName
protected java.lang.String getAttributeName(java.lang.String propertyName)
-
withPropertyBetween
public DynamoDBQueryCriteria<T,ID> withPropertyBetween(java.lang.String propertyName, java.lang.Object value1, java.lang.Object value2, java.lang.Class<?> type)
- Specified by:
withPropertyBetweenin interfaceDynamoDBQueryCriteria<T,ID>
-
withPropertyIn
public DynamoDBQueryCriteria<T,ID> withPropertyIn(java.lang.String propertyName, java.lang.Iterable<?> value, java.lang.Class<?> propertyType)
- Specified by:
withPropertyInin interfaceDynamoDBQueryCriteria<T,ID>
-
withSingleValueCriteria
public DynamoDBQueryCriteria<T,ID> withSingleValueCriteria(java.lang.String propertyName, com.amazonaws.services.dynamodbv2.model.ComparisonOperator comparisonOperator, java.lang.Object value, java.lang.Class<?> propertyType)
- Specified by:
withSingleValueCriteriain interfaceDynamoDBQueryCriteria<T,ID>
-
buildQuery
public Query<T> buildQuery(DynamoDBOperations dynamoDBOperations)
- Specified by:
buildQueryin interfaceDynamoDBQueryCriteria<T,ID>
-
buildCountQuery
public Query<java.lang.Long> buildCountQuery(DynamoDBOperations dynamoDBOperations, boolean pageQuery)
- Specified by:
buildCountQueryin interfaceDynamoDBQueryCriteria<T,ID>
-
buildSingleEntityLoadQuery
protected abstract Query<T> buildSingleEntityLoadQuery(DynamoDBOperations dynamoDBOperations)
-
buildSingleEntityCountQuery
protected abstract Query<java.lang.Long> buildSingleEntityCountQuery(DynamoDBOperations dynamoDBOperations)
-
buildFinderQuery
protected abstract Query<T> buildFinderQuery(DynamoDBOperations dynamoDBOperations)
-
buildFinderCountQuery
protected abstract Query<java.lang.Long> buildFinderCountQuery(DynamoDBOperations dynamoDBOperations, boolean pageQuery)
-
isOnlyHashKeySpecified
protected abstract boolean isOnlyHashKeySpecified()
-
withNoValuedCriteria
public DynamoDBQueryCriteria<T,ID> withNoValuedCriteria(java.lang.String propertyName, com.amazonaws.services.dynamodbv2.model.ComparisonOperator comparisonOperator)
- Specified by:
withNoValuedCriteriain interfaceDynamoDBQueryCriteria<T,ID>
-
withCondition
public DynamoDBQueryCriteria<T,ID> withCondition(java.lang.String propertyName, com.amazonaws.services.dynamodbv2.model.Condition condition)
-
getPropertyAttributeValue
protected <V> java.lang.Object getPropertyAttributeValue(java.lang.String propertyName, V value)
-
createNoValueCondition
protected <V> com.amazonaws.services.dynamodbv2.model.Condition createNoValueCondition(java.lang.String propertyName, com.amazonaws.services.dynamodbv2.model.ComparisonOperator comparisonOperator)
-
addAttributeValue
protected <P> java.util.List<com.amazonaws.services.dynamodbv2.model.AttributeValue> addAttributeValue(java.util.List<com.amazonaws.services.dynamodbv2.model.AttributeValue> attributeValueList, @Nullable java.lang.Object attributeValue, java.lang.Class<P> propertyType, boolean expandCollectionValues)
-
createSingleValueCondition
protected com.amazonaws.services.dynamodbv2.model.Condition createSingleValueCondition(java.lang.String propertyName, com.amazonaws.services.dynamodbv2.model.ComparisonOperator comparisonOperator, java.lang.Object o, java.lang.Class<?> propertyType, boolean alreadyMarshalledIfRequired)
-
createCollectionCondition
protected com.amazonaws.services.dynamodbv2.model.Condition createCollectionCondition(java.lang.String propertyName, com.amazonaws.services.dynamodbv2.model.ComparisonOperator comparisonOperator, java.lang.Iterable<?> o, java.lang.Class<?> propertyType)
-
withSort
public DynamoDBQueryCriteria<T,ID> withSort(org.springframework.data.domain.Sort sort)
- Specified by:
withSortin interfaceDynamoDBQueryCriteria<T,ID>
-
withProjection
public DynamoDBQueryCriteria<T,ID> withProjection(java.util.Optional<java.lang.String> projection)
- Specified by:
withProjectionin interfaceDynamoDBQueryCriteria<T,ID>
-
withLimit
public DynamoDBQueryCriteria<T,ID> withLimit(java.util.Optional<java.lang.Integer> limit)
- Specified by:
withLimitin interfaceDynamoDBQueryCriteria<T,ID>
-
-