Error insert in DynamoDB

0

I'm having a problem when I insert in dynamodb.

The problem comes because from the client (Angular5) I have to send an object to the server (SpringBoot), these objects have to be the same (same fields).

Then I send the id of the Angular object to the Springboot to null.

As SpringBoot receives the variable to null or with "" the key is not auto-generated and gives an error.

@DynamoDBTable(tableName = "ARTICLE")
public class Article{

    @Id
    private String ID_TABLE;

    private String description;

    public Article() {
    }

   public Article(String description) {
     this.description=description;
    }

   @DynamoDBHashKey(attributeName = "ID_TABLE")
    @DynamoDBAutoGeneratedKey
    public String getID_TABLE() {
        return ID_TABLE;
    }

   @DynamoDBAttribute(attributeName = "Description")
    public String getDescription() {
        return description;
    }
}

In Angular:

  export class Article{
    id: string;
    description: string;
  }

  let newParam: Article= {
            id: '', //o id: null
            description: 'chair' 
  };

ERROR:

com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException: null (Service: AmazonDynamoDBv2; Status Code: 407; Error Code: null; Request ID: null)
    
asked by EduBw 02.08.2018 в 13:25
source

0 answers