Class EntitySchema<T>
java.lang.Object
dev.hogwai.dynamodb.simplified.entity.EntitySchema<T>
- Type Parameters:
T- the entity type
Captures the schema metadata for an entity type used in single-table designs.
Read from an entity class via EntitySchemaReader.read(Class).
Provides access to the entity's discriminator, key components, and prefixes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordDescribes a single key component part with its attribute name, position, and a strategy for extracting the value from an entity instance. -
Method Summary
Modifier and TypeMethodDescription@Nullable StringcomputeKey(@NonNull String component, @NonNull T entity) Computes a composite key value from the entity's annotated components.@NonNull StringReturns the discriminator value for this entity type.@NonNull StringReturns the attribute name used to store the discriminator value.Returns the entity class.@Nullable List<EntitySchema.KeyComponentInfo> getKeyComponentInfo(@NonNull String component) Returns the key component info for a given component name, ornull.Returns the set of key component names defined for this entity.@NonNull StringReturns the DynamoDB table name.
-
Method Details
-
entityClass
-
discriminator
Returns the discriminator value for this entity type.- Returns:
- the discriminator value
-
discriminatorAttribute
Returns the attribute name used to store the discriminator value.- Returns:
- the discriminator attribute name
-
tableName
-
computeKey
Computes a composite key value from the entity's annotated components.- Parameters:
component- the key component name (e.g."PK"or"SK")entity- the entity instance to extract values from- Returns:
- the computed key string, or
nullif no components match
-
keyComponents
-
getKeyComponentInfo
Returns the key component info for a given component name, ornull.- Parameters:
component- the key component name- Returns:
- the list of component info entries, or
nullif not found
-