title: DynamoDB inheritance no mapping parent hash
body: <p>I have 3 class:</p>
  
  <pre><code>public abstract class Animal{
      private String id;
      private String name;
  
      @DynamoDBHashKey(attributeName = "Id")
      public String getId() {
          return id;
      }
      public void setId(String id) {
          this.id = id;
      }
      @DynamoDBAttribute(attributeName = "Name")
      public String getName() {
          return name;
      }
      public void setName(String name) {
          this.name = name;
      }
  }
  </code></pre>
  
  <p>Then a class Cat:</p>
  
  <pre><code>@DynamoDBTable(tableName = "Cat")
  public class Cat extends Animal{
      private String purr;
      @DynamoDBAttribute(attributeName = "Purr")
      public String getPurr() {
          return purr;
      }
      public void setPurr(String purr) {
          this.purr = purr;
      }
  }
  </code></pre>
  
  <p>And a similar class <code>Dog</code> that extends <code>Animal</code> and use another table called <em>Dog</em>: <code>@DynamoDBTable(tableName = "Dog")</code></p>
  
  <p>The problem is that when I try to save a <code>Cat</code>, I get the error: </p>
  
  <pre><code>Cat: does not map HASH key on model
  </code></pre>
  
  <p>But <code>Cat</code> should have the hash key of his superclass.</p>
  
  <p>I can solve moving the annotation: <code>@DynamoDBTable(tableName = "Cat")</code> from the class <code>Cat</code> to the superclass, it works to save <code>Cat</code>. I still have not tested if this will cause problem to <code>Dog</code>, but I don't think so, because it will be overwrited by  <code>@DynamoDBTable(tableName = "Dog")</code></p>
  
  <p>But this solution seem ugly to me. Is there a nicer solution? (I would consider to merge both the tables Dog and Cat to just one table called Animal.)</p>