Interface EntityTable<T>

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

public interface EntityTable<T>
Typed interface for single-table design operations on a DynamoDB table.

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

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    delete(@NonNull Object partitionKey)
    Deletes an item by its computed partition key.
    void
    delete(@NonNull Object partitionKey, @NonNull Object sortKey)
    Deletes an item by its computed partition and sort keys.
    @Nullable T
    get(@NonNull Object partitionKey)
    Gets an item by its composite partition key value.
    @Nullable T
    get(@NonNull Object partitionKey, @NonNull Object sortKey)
    Gets an item by its composite partition and sort keys.
    void
    put(@NonNull T entity)
    Puts an item, auto-computing composite keys and setting discriminator.
    @NonNull List<T>
    query(@NonNull Object partitionKey)
    Queries items sharing this partition key, auto-filtering by discriminator.
    @NonNull EntitySchema<T>
    Returns the EntitySchema for this entity type.
    @NonNull String
    Returns the DynamoDB table name associated with this entity.
    void
    update(@NonNull T entity)
    Updates an item, 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 the EntitySchema for this entity type.
      Returns:
      the entity schema
    • put

      void put(@NonNull T entity)
      Puts an item, auto-computing composite keys and setting discriminator.
      Parameters:
      entity - the entity to put
    • get

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

      @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:
      the matching entity, or null if not found
    • query

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

      void delete(@NonNull Object partitionKey)
      Deletes an item by its computed partition key.
      Parameters:
      partitionKey - the computed partition key value
    • delete

      void delete(@NonNull Object partitionKey, @NonNull Object sortKey)
      Deletes an item by its computed partition and sort keys.
      Parameters:
      partitionKey - the computed partition key value
      sortKey - the computed sort key value
    • update

      void update(@NonNull T entity)
      Updates an item, auto-computing composite keys.
      Parameters:
      entity - the entity with updated values