Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum Mapping #266

Open
gurpiarbassi opened this issue Sep 25, 2019 · 0 comments
Open

Enum Mapping #266

gurpiarbassi opened this issue Sep 25, 2019 · 0 comments

Comments

@gurpiarbassi
Copy link

gurpiarbassi commented Sep 25, 2019

Expected Behavior

Enums are mapped consistently

Actual Behavior

Finding that enums are not mapped when part of a nested DynamoDBDocument.

Steps to Reproduce the Problem

@DynamoDBTable(tableName = "Orders")
public class Order {
  //hash key
 // range key
 // attributes
 @DynamoDBAttribute(attributeName = "OrderData")
    private OrderData orderData;
}


@DynamoDBDocument
public class OrderData {
@DynamoDBAttribute(attributeName = "customer")
    private Customer customer;

 @DynamoDBAttribute(attributeName = "Source")
 @DynamoDBTypeConverted(converter = OrderChannel.OrderChannelEnumConverter.class)
    private OrderChannel source;
}

@DynamoDBDocument
public class Customer {
   @DynamoDBAttribute(attributeName = "customerType")
   @DynamoDBTypeConverted(converter = CustomerType.CustomerTypeConvertor)
    private CustomerType customerType;
}

The source attribute above persists perfectly. However the CustomerType does not.
Any enum that is more than 1 level deep in the DynamoDBDocument i.e in sub documents does not get converted into a string. It comes up as type B i.e. byte buffer.

The custom convertors mentioned above don't do anything clever apart from convert between enum to string and vice versa.

Specifications

  • Spring Data DynamoDB Version: 5.1.0 (2.1)
  • Spring Data Version: 2.1.10.RELEASE
  • AWS SDK Version: 1.11.415
  • Java Version: 1.8.0_192 - OpenJDK 64-Bit Server VM 25.192-b01
  • Platform Details: Mac OS X 10.14.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant