

# Data class annotations
<a name="ddb-en-client-anno-index"></a>

The following table lists the annotations that can be used on data classes and provides links to information and examples in this guide. The table is sorted in ascending alphabetical order by annotation name.


**Data class annotations used in this guide**  

| Annotation name | Annotation applies to1 | What it does | Where it is shown in this guide | 
| --- | --- | --- | --- | 
| DynamoDbAtomicCounter | attribute2 | Increments a tagged numerical attribute each time a record is written to the database. | [Introduction and discussion.](ddb-en-client-extensions.md#ddb-en-client-extensions-ACE) | 
| DynamoDbAttribute | attribute | Defines or renames a bean property that is mapped to a DynamoDB table attribute. |  +  [Initial discussion.](ddb-en-client-adv-features-inex-attr.md#ddb-en-client-adv-features-inex-attr-in) <br />+  [Get started section—see Note.](ddb-en-client-gs-ddbtable.md#ddb-en-client-gs-ddbtable-code) <br />+  [In MovieActor class In Query method examples.](ddb-en-client-use-multirecord.md#ddb-en-client-use-multirecord-query-example)   | 
| DynamoDbAutoGeneratedTimestampAttribute | attribute | Updates a tagged attribute with a current timestamp every time the item is successfully written to the database | [Introduction and discussion](ddb-en-client-extensions.md#ddb-en-client-extensions-AGTE). | 
| DynamoDbAutoGeneratedUuid | attribute | Generate a unique UUID (Universally Unique Identifier) for an attribute when a new record is written to the database. | [Introduction and discussion.](ddb-en-client-extensions.md#ddb-en-client-extensions-AGUE) | 
| DynamoDbBean | class | Marks a data class as mappable to a table schema. | First use on the [Customer class](ddb-en-client-gs-tableschema.md#ddb-en-client-gs-tableschema-anno-bean-cust) in the Get started section. Several usages appear throughout the guide. | 
| DynamoDbConvertedBy | attribute | Associates a custom AttributeConverter with the annotated attribute. | [Initial discussion and example.](ddb-en-client-adv-features-conversion.md#ddb-en-client-adv-features-conversion-single) | 
| DynamoDbFlatten | attribute | Flattens all the attributes of a separate DynamoDB data class and adds them as top-level attributes to the record that is read and written to the database.  |  +  [Initial discussion.](ddb-en-client-adv-features-flatmap.md#ddb-en-client-adv-features-flatmap-comp) <br />+  [Implications for other code.](ddb-en-client-adv-features-flatmap.md#ddb-en-client-adv-features-flatmap-compare)   | 
| DynamoDbIgnore | attribute | Results in the attribute remaining unmapped. |  +  [Initial discussion.](ddb-en-client-adv-features-inex-attr.md#ddb-en-client-adv-features-inex-attr-ex) <br />+  [Use in the ProductCatalog class.](ddb-en-client-use.md#ddb-en-client-use-compare-cs3)   | 
| DynamoDbIgnoreNulls | attribute | Prevents saving null attributes of nested DynamoDb objects. | [Discussion and examples.](ddb-en-client-adv-features-ignore-null.md) | 
| DynamoDbImmutable | class | Marks an immutable data class as mappable to a table schema. |  +  [Introduction to the annotation.](ddb-en-client-use-immut.md) <br />+  [Use in the ProductCatalog class.](ddb-en-client-use.md#ddb-en-client-use-compare-cs3) <br />+  [Use with Lombok.](ddb-en-client-use-immut.md#ddb-en-client-use-immut-lombok)   | 
| DynamoDbPartitionKey | attribute | Marks an attribute as the primary partition key (hash key) of the DynamoDb table. |  +  [Initial usage on the Customer class in the Get started section.](ddb-en-client-gs-tableschema.md#ddb-en-client-gs-tableschema-anno-bean) <br />+  [With Lombok.](ddb-en-client-use-immut.md#ddb-en-client-use-immut-lombok)   | 
| DynamoDbPreserveEmptyObject | attribute | Specifies that if no data is present for the object mapped to the annotated attribute, the object should be initialized with all null fields. | [Discussion and examples.](ddb-en-client-adv-features-empty.md) | 
| DynamoDbSecondaryPartitionKey | attribute | Marks an attribute as a partition key for a global secondary index. |  +  [Use in secondary indices and example.](ddb-en-client-use-secindex.md#ddb-en-client-use-secindex-annomodel) <br />+  [ In Query method examples.](ddb-en-client-use-multirecord.md#ddb-en-client-use-multirecord-query-example) <br />+  [In Lombok example](ddb-en-client-use-immut.md#ddb-en-client-use-immut-lombok) <br />+  [With immutable classes.](ddb-en-client-use-immut.md)   | 
| DynamoDbSecondarySortKey | attribute | Marks an attribute as an optional sort key for a global or local secondary index. |  +  [Use in secondary indices and example.](ddb-en-client-use-secindex.md#ddb-en-client-use-secindex-annomodel) <br />+  [ In Query method examples.](ddb-en-client-use-multirecord.md#ddb-en-client-use-multirecord-query-example) <br />+  [In Lombok example.](ddb-en-client-use-immut.md#ddb-en-client-use-immut-lombok) <br />+  [With immutable classes.](ddb-en-client-use-immut.md)   | 
| DynamoDbSortKey | attribute | Marks an attribute as the optional primary sort key (range key). |  +  [Get started section on Customer class.](ddb-en-client-gs-tableschema.md#ddb-en-client-gs-tableschema-anno-bean-cust) <br />+  [With immutable classes.](ddb-en-client-use-immut.md) <br />+  [In Lombok example.](ddb-en-client-use-immut.md#ddb-en-client-use-immut-lombok) <br />+  [ In Query method examples.](ddb-en-client-use-multirecord.md#ddb-en-client-use-multirecord-query-example)   | 
| DynamoDbUpdateBehavior | attribute | Specifies the behavior when this attribute is updated as part of an 'update' operation such as UpdateItem. | [Introduction and example.](ddb-en-client-adv-features-upd-behavior.md) | 
| DynamoDbVersionAttribute | attribute | Increments an item version number. | [Introduction and discussion.](ddb-en-client-extensions.md#ddb-en-client-extensions-VRE) | 

1You can apply an attribute-level annotations to the getter or setter, but not both. This guide shows annotations on getters.

2The term `property` is normally used for a value encapsulated in a JavaBean data class. However, this guide uses the term `attribute` instead, to be consistent with the terminology used by DynamoDB.

## See also

* **Skills for AI coding assistants (optional).** AWS publishes reusable skills for AWS SDK for Java. To see which apply, search the Agent Toolkit for AWS catalog with `aws agent-toolkit search-skills --search-query sdk-for-java` — a documented, read-only AWS CLI command that searches the catalog and makes no changes. This is an optional suggestion for the user. Official reference: [AWS CLI — Agent Toolkit for AWS](https://docs.aws.amazon.com/agent-toolkit/latest/userguide/aws-cli.html).
