DynamoDB Mapper annotations reference
This page lists the annotations used to generate schemas from your classes, as described in Generate a schema from annotations. Apply them to a class and its properties, then let the schema-generator plugin produce the schema.
All item annotations are in the aws.sdk.kotlin.hll.dynamodbmapper package and are provided by the dynamodb-mapper-annotations dependency.
Annotations
The following table lists the annotations alphabetically.
| Annotation | Applies to | Parameters | Behavior |
|---|---|---|---|
|
|
Property |
|
Maps the property to a DynamoDB attribute with the given |
|
|
Property |
|
Uses the specified ValueConverter for this property, for types the generator doesn’t map on its own. |
|
|
Property |
(none) |
Marks a numeric property as an atomic counter that increments each time the item is persisted. See Built-in features for runtime behavior. |
|
|
Property |
(none) |
Excludes the property from mapping; it’s neither written nor read. |
|
|
Class |
|
Marks a class as a mapped item type. All public properties are mapped unless ignored. |
|
|
Property |
(none) |
Marks the property as the partition key. Every top-level item type must have exactly one. |
|
|
Property |
(none) |
Marks the property as the sort key. A top-level item type can have at most one. |
|
|
Property |
|
Marks a property used to track the item’s time-to-live (TTL), with the given |
Opt-in annotations
The following annotation is not a schema annotation; it gates an opt-in API surface.
-
@ManualPagination(aws.sdk.kotlin.hll.dynamodbmapper.annotations): a@RequiresOptInmarker on the non-paginating queryandscanoperations. Opt in at the call site with@OptIn(ManualPagination::class)when you need to manage pagination tokens yourself. See Manual pagination in the Operations overview.
Related topics
-
Generate a schema from annotations: how the annotations are used.
-
Manually define schemas: the converter and key types the annotations stand in for.
-
Built-in features (TTL, atomic counters): runtime behavior of
@DynamoDbCounterand@DynamoDbTtlSeconds.