title: Object models for DyanamoDbTable
body: <p>I’m entirely new to DynamoDB
  After researching I concluded to use ONE table for app design.</p>
  <p>So I have a DynamoDB Table as <code>PK, SK, CONTENT, &lt; MANY OTHER ATTRIBUTES&gt;</code>.<br />
  My model in java looks something like below</p>
  <pre><code>@DynamoDBTable(tableName = “my-data&quot;)
  public class MyData {
  
      @DynamoDBHashKey(attributeName = &quot;pk&quot;)
      private String partitionKey;
  
      @DynamoDBRangeKey(attributeName = &quot;sk&quot;)
      private String sortKey; 
  
      @DynamoDBAttribute(attributeName = &quot;content&quot;)
      private String content; //non queried content, I’ll save as JSON
  
  
      //below are the attributes which I MIGHT want to queries on later maybe be I'll end up creating GSI or LSI
  
      @DynamoDBAttribute(attributeName = &quot;field1&quot;)
      private String field1;
      @DynamoDBAttribute(attributeName = &quot;field2&quot;)
      private String field2;
      @DynamoDBAttribute(attributeName = &quot;field3&quot;)
      private String field3;
      @DynamoDBAttribute(attributeName = &quot;field4&quot;)
      private String field4;
      @DynamoDBAttribute(attributeName = &quot;field5&quot;)
      private String field5;
      @DynamoDBAttribute(attributeName = &quot;field6&quot;)
      private String field6;
      @DynamoDBAttribute(attributeName = &quot;field7&quot;)
      private String field7;
  
  }
  </code></pre>
  <p>Now what I want is,<br />
  I want to have a different class let's call it <code>MySearchableData</code> having field1 to field7. And then I want to have <code>MySearchableData</code> inside <code>MyData</code>  like below.</p>
  <pre><code>@DynamoDBTable(tableName = “my-data&quot;)
  public class KaleidoscopeData {
  
      @DynamoDBHashKey(attributeName = &quot;pk&quot;)
      private String partitionKey;
  
      @DynamoDBRangeKey(attributeName = &quot;sk&quot;)
      private String sortKey; // ISO 8601 time string
  
      @DynamoDBAttribute(attributeName = &quot;content&quot;)
      private String content; //non queried JSON content  
  
       // ?? what annotation to use here       
      private MySearchableData mysearchableData;      
  
  }
  
  public class MySearchableData{
  
      private String field1;
      private String field2;
      private String field3;
      private String field4;
      private String field5;
      private String field6;
      private String field7;
  }
  </code></pre>
  <p><strong>Question is</strong>.
  What annotation to use so all these fields from <code>MySearchableData</code>  will be treated as attributes in AWS <code>my-data</code> tables</p>
  <hr />
  <p><strong>UPDATE</strong>
  I am unable to find any annotation for nested classes at AWS documentation
  <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBMapper.Annotations.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBMapper.Annotations.html</a></p>