Convert an external POJO as Map type in DynamoDBEnhancedClient

Viewed 12

DynamoDBEnchanced api provides with @DynamoDBBean that is placed on the POJO to save complex objects into dynamodb without having to externally use ways like ObjectMapper to convert them into JSON strings and save. @DynamoBean allows to save the objects in the form of Map i.e M type I have a below POJO which I want to save in dynamodb, however there is an Address var which is of type that is included as jar and we cannot modify its source code. And hence cannot add @DynamoDBBean on it to save it as M type.

Due to which I have to add an attributeconverter to convert that POJO to json string which defeats the whole purpose. Is there any other way to save the external POJO as M type without using converters? Any other annotation that can be placed on the field?

Entity.java

@DynamoDBBean
class Entity 
{
String name
String id
Address address
}

Address.java

class Address
{
  String street
  long streetnumber
}
0 Answers
Related