title: Can I "override" annotations of a superclass's private field?
body: <p><em>20 years in other programming languages and now I am new to Java, feeling like an noob programmer...</em></p>
  
  <p>I use an <code>Indexable</code> abstract class to extend all of my <code>@entity</code> classes so I don't need to put the <code>@Id @GeneratedValue @SequenceGenerator</code> on all of them. And I also have <code>Auditable</code> with <code>@CreatedBy @CreatedDate @ModifiedBy @ModifiedDate</code> which leads to those inheritance path:</p>
  
  <ul>
  <li>MostEntityClasses > AuditableClass > IndexableClass;</li>
  <li>SomeEntityClasses > IndexableClass.</li>
  </ul>
  
  <p>Now I noticed that 99% of my entity classes also have: </p>
  
  <pre><code>@Column(nullable = false, unique = true) private String name;
  </code></pre>
  
  <p>I thought of moving that line to the <code>Indexable</code> class to avoid that boilerplate code in those 99%, but the two classes that don't have the <em>name</em> field are important <em>auditable</em> classes and I don't want to just copy all the ancestor fields to them just to prevent errors of null names on it.</p>
  
  <p><strong>The question is:</strong> if I override that field's annotations on those two classes to make it nullable and transient, will it work to avoid creating this field on the table and also not bothering the user with null names?</p>
  
  <pre><code>class SomeAuditableClass extends Audited {
    //@override
    @Column(nullable = true) @Transient private String name;
  </code></pre>
  
  <p><em>The content in <a href="https://stackoverflow.com/questions/685300/is-there-a-way-to-override-class-variables-in-java">Is there a way to override class variables in Java?</a> did not helped much...</em></p>