title: DynamoDb querying Enum
body: <p>I am new to dynamoDB and this question might be juvenile.</p>
  
  <p>I am trying to query an item from the table but dynamo api is not able to convert the query json result into the class instance because there is an enum variable member present in the class.</p>
  
  <blockquote>
    <p>My class Structure:[note that RequestStage is a Enum member]</p>
  </blockquote>
  
  <pre><code>@DynamoDBTable(tableName = "LoadInfoProvider")
  @Data
  @Builder
  @NoArgsConstructor
  @AllArgsConstructor
  public final class LoadInfoProvider {
  
  /** The load request ID. */
  @DynamoDBRangeKey
  private String loadRequestID;
  
  /** The load request creation id. */
  @DynamoDBHashKey
  private String loadRequestCreationId;
  
  /** The carrier ID. */
  private String carrierID;
  
  /** The carrier pool. */
  private String carrierPool;
  
  /** The carrier details. */
  private CarrierDetail carrierDetails;
  
  /** The driver assignment required. */
  private Boolean driverAssignmentRequired;
  
  /** The driver pool. */
  private String driverPool;
  
  /** The trailer attachment required. */
  private Boolean trailerAttachmentRequired;
  
  /** The request type. */
  private String requestType;
  
  /** The request stage. */
  private RequestStage requestStage;
  
  /** The created time. */
  private String createdTime;
  
  /** The consumed time. */
  private String consumedTime;
  
  /** The provider status. */
  private String providerStatus;
  
  /** The is consumed. */
  private Boolean isConsumed;
  
  /** The request status. */
  private RequestStatus requestStatus;
  
  /** The trip. */
  private Trip trip;
  }
  </code></pre>
  
  <blockquote>
    <p>RequestStageEnum :</p>
  </blockquote>
  
  <pre><code>@NoArgsConstructor
  @AllArgsConstructor(access = AccessLevel.PUBLIC)
  @DynamoDBDocument
  public enum RequestStage {
  
  /** The initiated. */
  INITIATED("initiated"),
  
  /** The passed. */
  PASSED("passed"),
  
  /** The failed. */
  FAILED("failed");
  
  /** The value. */
  @Getter
  @Setter
  private String value;
  
  }
  </code></pre>
  
  <p>When i query something from this table, i am getting the below error.</p>
  
  <blockquote>
    <p>Exception in thread "main" com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMappingException: Failed to instantiate new instance of class
        at com.amazonaws.services.dynamodbv2.datamodeling.ConversionSchemas$StandardItemConverter.createObject(ConversionSchemas.java:614)
        at com.amazonaws.services.dynamodbv2.datamodeling.ConversionSchemas$StandardItemConverter.unconvert(ConversionSchemas.java:414)
        at com.amazonaws.services.dynamodbv2.datamodeling.unmarshallers.ObjectUnmarshaller.unmarshall(ObjectUnmarshaller.java:54)
        at com.amazonaws.services.dynamodbv2.datamodeling.unmarshallers.NullableUnmarshaller.unmarshall(NullableUnmarshaller.java:46)
        at com.amazonaws.services.dynamodbv2.datamodeling.ConversionSchemas$StandardItemConverter.unmarshall(ConversionSchemas.java:593)
        at com.amazonaws.services.dynamodbv2.datamodeling.ConversionSchemas$StandardItemConverter.unconvert(ConversionSchemas.java:426)
        at com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper.privateMarshallIntoObject(DynamoDBMapper.java:630)
        at com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper.marshallIntoObjects(DynamoDBMapper.java:661)
        at com.amazonaws.services.dynamodbv2.datamodeling.PaginatedQueryList.(PaginatedQueryList.java:65)
        at com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper.query(DynamoDBMapper.java:1856)
        at com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper.query(DynamoDBMapper.java:1844)
        at com.amazon.optimus.dynamoHelper.DynamoDBUtil.queryRecord(DynamoDBUtil.java:112)
        at com.amazon.optimus.dynamoHelper.DynamoDBUtil.main(DynamoDBUtil.java:164)
    Caused by: java.lang.InstantiationException: com.amazon.optimus.enums.RequestStage
        at java.lang.Class.newInstance(Class.java:427)
        at com.amazonaws.services.dynamodbv2.datamodeling.ConversionSchemas$StandardItemConverter.createObject(ConversionSchemas.java:611)
        ... 12 more
    Caused by: java.lang.NoSuchMethodException: com.amazon.optimus.enums.RequestStage.()
        at java.lang.Class.getConstructor0(Class.java:3082)
        at java.lang.Class.newInstance(Class.java:412)
        ... 13 more</p>
  </blockquote>
  
  <p>It's clear from the exception, java is not able to instantiate the enum. How i can fix this and make this working? Your help is appreciated and thanks.</p>