Interface DynamoDbOperations

All Known Implementing Classes:
DynamoDbTemplate

public interface DynamoDbOperations
Main API for DynamoDB persistence, reads, queries, scans, and updates.
Since:
1.0.0
Author:
Matej Nedic
  • Method Details

    • save

      <T> EntityWriteResult<T> save(T entity)
      Saves an entity with PutItem.
    • save

      <T> EntityWriteResult<T> save(T entity, DynamoDbConditionRequest dynamoDBConditionRequest)
      Saves an entity with a conditional PutItem.
    • insert

      <T> EntityWriteResult<T> insert(T entity)
      Inserts an entity and fails if its key already exists.
    • saveAll

      <T> Iterable<T> saveAll(Iterable<? extends T> entities)
      Saves entities with chunked BatchWriteItem requests.
    • delete

      void delete(Object entity)
      Deletes the supplied entity.
    • delete

      <T> void delete(Class<T> entityClass, Object primaryKey, @Nullable Object sortKey)
      Deletes an item by partition and optional sort key.
    • delete

      <T> void delete(Class<T> entityClass, Object primaryKey, @Nullable Object sortKey, DynamoDbConditionRequest dynamoDBConditionRequest)
      Deletes an item by key when the condition succeeds.
    • getConverter

      DynamoDbConverter getConverter()
      Returns:
      the converter used by these operations
    • query

      <T> EntityQueryResult<List<T>> query(Class<T> entityClass, DynamoDbQueryRequest queryRequest, DynamoDbPageRequest dynamoDBPageRequest)
      Executes one DynamoDB query page.
    • executeStatement

      <T> EntityReadResult<List<T>> executeStatement(String statement, String nextToken, Class<T> entityClass, List<Object> values)
      Executes a PartiQL statement with positional values.
    • executeStatement

      <T> EntityReadResult<List<T>> executeStatement(String statement, String nextToken, Class<T> entityClass)
      Executes a PartiQL statement without positional values.
    • executeStatement

      <T> EntityReadResult<List<T>> executeStatement(String statement, String nextToken, Class<T> entityClass, List<Object> values, Boolean consistentRead)
      Executes a PartiQL statement with positional values and explicit read consistency.
    • findById

      <T> @Nullable T findById(Object id, Class<T> entityClass)
      Finds an item by its partition key.
    • findById

      <T> @Nullable T findById(Object id, Class<T> entityClass, Boolean consistentRead)
      Finds an item by its partition key with explicit read consistency.
    • findById

      <T> @Nullable T findById(Object partitionKey, @Nullable Object sortKey, Class<T> entityClass)
      Finds an item by its partition and optional sort key.
    • findById

      <T> @Nullable T findById(Object partitionKey, @Nullable Object sortKey, Class<T> entityClass, Boolean consistentRead)
      Finds an item by both keys with explicit read consistency.
    • existsById

      <T> boolean existsById(Object partitionKey, @Nullable Object sortKey, Class<T> entityClass)
      Checks whether an item exists without converting it.
    • update

      <T> EntityWriteResult<T> update(T entity)
      Updates an item from the supplied entity state.
    • update

      <T> EntityWriteResult<T> update(Object partitionKey, @Nullable Object sortKey, DynamoDbUpdateExpressionRequest dynamoDBUpdateExpressionRequest, Class<T> entityClass)
      Updates an item with an explicit update request.
    • update

      <T> EntityWriteResult<T> update(Object partitionKey, @Nullable Object sortKey, DynamoDbUpdateExpressionRequestInterface builderFunction, Class<T> entityClass)
      Updates an item with a fluent update-expression callback.
    • scan

      <T> EntityQueryResult<List<T>> scan(Class<T> entityClass, DynamoDbScanRequest scanRequest)
      Executes one DynamoDB scan page.
    • count

      <T> long count(Class<T> entityClass)
      Counts every item visible through the entity mapping.
    • count

      <T> long count(Class<T> entityClass, DynamoDbScanRequest scanRequest)
      Counts items matching a scan request.
    • count

      <T> long count(Class<T> entityClass, DynamoDbQueryRequest queryRequest)
      Counts items matching a query request.
    • exists

      <T> boolean exists(Class<T> entityClass, DynamoDbScanRequest scanRequest)
      Checks whether a scan has at least one match.
    • exists

      <T> boolean exists(Class<T> entityClass, DynamoDbQueryRequest queryRequest)
      Checks whether a query has at least one match.
    • findAll

      <T> List<T> findAll(Class<T> entityClass)
      Reads all items visible through the entity mapping.
    • getTableName

      String getTableName(Class<?> entityClass)
      Returns:
      the resolved physical table name for the entity
    • queryItemCollection

      <A> EntityQueryResult<A> queryItemCollection(Class<A> viewClass, DynamoDbQueryRequest dynamoDbRequest, DynamoDbPageRequest dynamoDBPageRequest)
      Queries and folds one DynamoDB page into an item-collection view.
      Returns:
      the folded page, count, and optional continuation cursor
    • query

      <T> IndexQueryBuilder<T> query(Class<T> entityClass, String indexName)
      Starts a typed query against the named index.