Interface AsyncEntityTable<T>

Type Parameters:
T - the entity type, annotated with @Entity

public interface AsyncEntityTable<T>
Async typed interface for single-table design operations on a DynamoDB table.

Mirrors EntityTable but returns CompletableFuture from all mutating and query methods to support asynchronous execution.

Provides high-level methods that automatically compute composite keys from @KeyComponent-annotated fields and filter by discriminator on query operations.

  • Method Details

    • tableName

      @NonNull String tableName()
      Returns the DynamoDB table name associated with this entity.
      Returns:
      the table name
    • schema

      @NonNull EntitySchema<T> schema()
      Returns the EntitySchema for this entity type.
      Returns:
      the entity schema
    • put

      @NonNull CompletableFuture<Void> put(@NonNull T entity)
      Puts an item asynchronously, auto-computing composite keys and setting discriminator.
      Parameters:
      entity - the entity to put
      Returns:
      a future that completes when the item has been put
    • get

      @NonNull CompletableFuture<@Nullable T> get(@NonNull Object partitionKey)
      Gets an item by its composite partition key value.
      Parameters:
      partitionKey - the computed partition key value
      Returns:
      a future containing the matching entity, or null if not found
    • get

      @NonNull CompletableFuture<@Nullable T> get(@NonNull Object partitionKey, @NonNull Object sortKey)
      Gets an item by its composite partition and sort keys.
      Parameters:
      partitionKey - the computed partition key value
      sortKey - the computed sort key value
      Returns:
      a future containing the matching entity, or null if not found
    • query

      @NonNull CompletableFuture<List<T>> query(@NonNull Object partitionKey)
      Queries items sharing this partition key asynchronously, auto-filtering by discriminator.
      Parameters:
      partitionKey - the computed partition key value
      Returns:
      a future containing matching entities (never null)
    • deleteEntity

      @NonNull CompletableFuture<Void> deleteEntity(@NonNull T entity)
      Deletes an item asynchronously by extracting its computed partition and sort keys from the given entity.
      Parameters:
      entity - the entity whose keys identify the item to delete
      Returns:
      a future that completes when the item has been deleted
    • delete

      @NonNull CompletableFuture<Void> delete(@NonNull Object partitionKey)
      Deletes an item asynchronously by its computed partition key.
      Parameters:
      partitionKey - the computed partition key value
      Returns:
      a future that completes when the item has been deleted
    • delete

      @NonNull CompletableFuture<Void> delete(@NonNull Object partitionKey, @NonNull Object sortKey)
      Deletes an item asynchronously by its computed partition and sort keys.
      Parameters:
      partitionKey - the computed partition key value
      sortKey - the computed sort key value
      Returns:
      a future that completes when the item has been deleted
    • update

      @NonNull CompletableFuture<T> update(@NonNull T entity)
      Updates an item asynchronously, auto-computing composite keys.
      Parameters:
      entity - the entity with updated values
      Returns:
      a future containing the updated item as returned by DynamoDB