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 Summary
Modifier and TypeMethodDescription@NonNull CompletableFuture<Void> Deletes an item asynchronously by its computed partition key.@NonNull CompletableFuture<Void> Deletes an item asynchronously by its computed partition and sort keys.@NonNull CompletableFuture<Void> deleteEntity(@NonNull T entity) Deletes an item asynchronously by extracting its computed partition and sort keys from the given entity.@NonNull CompletableFuture<@Nullable T> Gets an item by its composite partition key value.@NonNull CompletableFuture<@Nullable T> Gets an item by its composite partition and sort keys.@NonNull CompletableFuture<Void> Puts an item asynchronously, auto-computing composite keys and setting discriminator.@NonNull CompletableFuture<List<T>> Queries items sharing this partition key asynchronously, auto-filtering by discriminator.@NonNull EntitySchema<T> schema()Returns theEntitySchemafor this entity type.@NonNull StringReturns the DynamoDB table name associated with this entity.@NonNull CompletableFuture<T> Updates an item asynchronously, auto-computing composite keys.
-
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 theEntitySchemafor this entity type.- Returns:
- the entity schema
-
put
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
Gets an item by its composite partition key value.- Parameters:
partitionKey- the computed partition key value- Returns:
- a future containing the matching entity, or
nullif not found
-
get
Gets an item by its composite partition and sort keys.- Parameters:
partitionKey- the computed partition key valuesortKey- the computed sort key value- Returns:
- a future containing the matching entity, or
nullif not found
-
query
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
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
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
Deletes an item asynchronously by its computed partition and sort keys.- Parameters:
partitionKey- the computed partition key valuesortKey- the computed sort key value- Returns:
- a future that completes when the item has been deleted
-
update
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
-