title: How to access discriminator column in JPA
body: <p>I have <code>DisseminationArea</code> as subcalss for <code>Feature</code> with the following code:</p>
  
  <pre><code>@Entity
  @Table(name = "features")
  @Inheritance(strategy = InheritanceType.JOINED)
  @DiscriminatorColumn(name = "subtype_id", discriminatorType = DiscriminatorType.INTEGER)
  public class Feature {
  
     @Id
     @Column(name="id")
     @GeneratedValue(generator="sqlite")
     @TableGenerator(name="sqlite", table="sqlite_sequence",
        pkColumnName="name", valueColumnName="seq",
        pkColumnValue="features")
     @Getter
     @Setter
     private long id;
  
     @ManyToOne
     @JoinColumn(name = "subtype_id")
     @Getter
     @Setter
     private FeatureSubtype featureSubtype;
  
     @ManyToOne
     @JoinColumn(name = "parent_id")
     @Getter
     @Setter
     private Feature parent;
  
     ...    
  }
  </code></pre>
  
  <p>Unfortunately, this causes an exception when save this entity to database, because <code>subtype_id</code> field is used twice.</p>
  
  <p>Can I annotate it somehow so that JPA know it is the same field?</p>