title: Avoiding Duplication of RiakKey in BaseEntity and derived classes
body: <p>I have a base class which is a Riak entity, and some derived classes that extends BaseEntity.
  BaseEntity has a field named Identifier which is annotated as @RiakKey.</p>
  
  <p>but apparently this is not enought. It seems that I must have the Identifier field, with the @RuiakKey anotation in each derived class, otherwise I get this exception:</p>
  
  <blockquote>
    <p>com.basho.riak.client.convert.NoKeySpecifedException
        at com.basho.riak.client.bucket.DefaultBucket.fetch(DefaultBucket.java:535)
        at com.att.cso.omss.datastore.riak.controllers.RiakBaseController.isEntityExist(RiakBaseController.java:130)
        at com.att.cso.omss.datastore.riak.controllers.RiakBaseController.createEntity(RiakBaseController.java:94)
        at com.att.cso.omss.datastore.riak.controllers.RiakBaseController.createServiceProvider(RiakBaseController.java:234)
        at com.att.cso.omss.datastore.riak.App.serviceProviderTests(App.java:62)
        at com.att.cso.omss.datastore.riak.App.main(App.java:38)</p>
  </blockquote>
  
  <p>So, my current implementation looks like this (duplication of the identifier field):</p>
  
  <blockquote>
    <p>public class BaseEntity{</p>
    
    <p>@RiakKey 
      @JsonProperty("Id")
        protected String identifier;</p>
  </blockquote>
  
  <pre><code>public String getIdentifier() {
      return identifier;
  }
  
  public void setIdentifier(String identifier) {
      this.identifier = identifier;
  }
  </code></pre>
  
  <p>.
  .
  .</p>
  
  <blockquote>
    <p>public class Service extends BaseEntity{</p>
  </blockquote>
  
  <pre><code>@RiakKey 
  @JsonProperty("Id")
  protected String identifier;
  
  public String getIdentifier() {
      return identifier;
  }
  
  public void setIdentifier(String identifier) {
      this.identifier = identifier;
  }
  </code></pre>
  
  <p>is there a way to avoid this duplication?</p>