Creating a custom object for the DynamoDB table using the object persistence model in Java

Now, we are going to see how to create a custom object as an attribute while using the object persistence model.

Getting ready

To perform this recipe, you should have set up the project, as described in the earlier recipes, specifically pom.xml, and also set up dependencies and the object model.

How to do it…

Sometimes, we need custom composite objects in order to represent our data models. Suppose that in our product table, we want to store the dimensions of the product; to do so, we can create the class of this type and use the DynamoDBMarshalling annotation. While doing so, we also need to specify the converter in which we have to specify to read and write ...

Get DynamoDB Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.