title: Is it possible to add JPA annotation to superclass instance variables?
body: <p>I am creating entities that are  the same for two different tables. In order do table mappings etc. different for the two entities but only have the rest of the code in one place - an abstract superclass. The best thing would be to be able to annotate generic stuff such as column names (since the will be identical) in the super class but that does not work because JPA annotations are not inherited by child classes. Here is an example:</p>
  
  <pre><code>public abstract class MyAbstractEntity {
  
    @Column(name="PROPERTY") //This will not be inherited and is therefore useless here
    protected String property;
  
  
    public String getProperty() {
      return this.property;
    }
  
    //setters, hashCode, equals etc. methods
  }
  </code></pre>
  
  <p>Which I would like to inherit and only specify the child-specific stuff, like annotations:</p>
  
  <pre><code>@Entity
  @Table(name="MY_ENTITY_TABLE")
  public class MyEntity extends MyAbstractEntity {
  
    //This will not work since this field does not override the super class field, thus the setters and getters break.
    @Column(name="PROPERTY") 
    protected String property;
  
  }
  </code></pre>
  
  <p>Any ideas or will I have to create fields, getters and setters in the child classes?</p>
  
  <p>Thanks,
  Kris</p>