title: Repeated column in mapping for entity: Hiv_AnswerForEntities column: variant_id (should be mapped with insert="false" update="false")
body: <p>I have problem with inheritance in ORM.</p>
  
  <p>I use JPA/hibernate. I am getting an error that I do not understand. I have declared once column, but error tell me that I've done this twice. It can be messed with inheritance somehow. 
  But I don't know why. Please help</p>
  
  <p>Error I get:</p>
  
  <pre><code>Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: myInsurance.models.liability.hivAndVHProtection.Hiv_AnswerForEntities column: variant_id (should be mapped with insert="false" update="false")
  </code></pre>
  
  <p>Entities code:</p>
  
  <pre><code>@MappedSuperclass
  @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
  public class Answer extends Generic&lt;Answer&gt; {
      @OneToOne public Variant variant;
  
  }
  
  @Entity
  @DiscriminatorValue("Answer")
  @Table(name="mi__Liability_Part_Hiv_Answer")
  @Inheritance(strategy=InheritanceType.SINGLE_TABLE)
  public class Hiv_Answer extends Answer {
      @OneToOne public HivAndVHProtection_Variant variant;
  }
  
  @Entity
  @DiscriminatorValue("AnswerForEntities")
  public class Hiv_AnswerForEntities extends Hiv_Answer {
  
      public int proffesionGroup;
      public int personCount;
      public int contributionPerPerson;
      @Transient public int totalContribution;
  }
  </code></pre>
  
  <p>And full stack trace:</p>
  
  <pre><code>play.api.UnexpectedException: Unexpected exception[PersistenceException: [PersistenceUnit: defaultPersistenceUnit] Unable to build EntityManagerFactory]
          at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:148) ~[play_2.10.jar:2.2.6]
          at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:112) ~[play_2.10.jar:2.2.6]
          at scala.Option.map(Option.scala:145) ~[scala-library.jar:na]
          at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:112) ~[play_2.10.jar:2.2.6]
          at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:110) ~[play_2.10.jar:2.2.6]
          at scala.util.Success.flatMap(Try.scala:200) ~[scala-library.jar:na]
          at play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:110) ~[play_2.10.jar:2.2.6]
          at play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:102) ~[play_2.10.jar:2.2.6]
          at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) ~[scala-library.jar:na]
          at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) ~[scala-library.jar:na]
          at scala.concurrent.forkjoin.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1361) ~[scala-library.jar:na]
          at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) ~[scala-library.jar:na]
          at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) ~[scala-library.jar:na]
          at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) ~[scala-library.jar:na]
          at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) ~[scala-library.jar:na]
  Caused by: javax.persistence.PersistenceException: [PersistenceUnit: defaultPersistenceUnit] Unable to build EntityManagerFactory
          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:915) ~[hibernate-entitymanager-4.2.0.CR1.jar:4.2.0.CR1]
          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890) ~[hibernate-entitymanager-4.2.0.CR1.jar:4.2.0.CR1]
          at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:57) ~[hibernate-entitymanager-4.2.0.CR1.jar:4.2.0.CR1]
          at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63) ~[hibernate-jpa-2.0-api.jar:1.0.1.Final]
          at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47) ~[hibernate-jpa-2.0-api.jar:1.0.1.Final]
          at play.db.jpa.JPAPlugin.onStart(JPAPlugin.java:35) ~[play-java-jpa_2.10.jar:2.2.6]
          at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88) ~[play_2.10.jar:2.2.6]
          at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88) ~[play_2.10.jar:2.2.6]
          at scala.collection.immutable.List.foreach(List.scala:318) ~[scala-library.jar:na]
          at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:88) ~[play_2.10.jar:2.2.6]
          at play.api.Play$$anonfun$start$1.apply(Play.scala:88) ~[play_2.10.jar:2.2.6]
          at play.api.Play$$anonfun$start$1.apply(Play.scala:88) ~[play_2.10.jar:2.2.6]
          at play.utils.Threads$.withContextClassLoader(Threads.scala:18) ~[play_2.10.jar:2.2.6]
          at play.api.Play$.start(Play.scala:87) ~[play_2.10.jar:2.2.6]
          at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:139) ~[play_2.10.jar:2.2.6]
          ... 14 common frames omitted
  Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: myInsurance.models.liability.hivAndVHProtection.Hiv_AnswerForEntities column: variant_id (should be mapped with insert="false" update="false")
          at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:682) ~[hibernate-core-4.2.0.CR1.jar:4.2.0.CR1]
          at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:704) ~[hibernate-core-4.2.0.CR1.jar:4.2.0.CR1]
          at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:726) ~[hibernate-core-4.2.0.CR1.jar:4.2.0.CR1]
          at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:479) ~[hibernate-core-4.2.0.CR1.jar:4.2.0.CR1]
          at org.hibernate.mapping.UnionSubclass.validate(UnionSubclass.java:61) ~[hibernate-core-4.2.0.CR1.jar:4.2.0.CR1]
          at org.hibernate.cfg.Configuration.validate(Configuration.java:1283) ~[hibernate-core-4.2.0.CR1.jar:4.2.0.CR1]
          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1734) ~[hibernate-core-4.2.0.CR1.jar:4.2.0.CR1]
          at org.hibernate.ejb.EntityManagerFactoryImpl.&lt;init&gt;(EntityManagerFactoryImpl.java:94) ~[hibernate-entitymanager-4.2.0.CR1.jar:4.2.0.CR1]
          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905) ~[hibernate-entitymanager-4.2.0.CR1.jar:4.2.0.CR1]
          ... 28 common frames omitted
  </code></pre>
  
  <p>--EDIT--</p>
  
  <p>All my <code>Variant</code> classes that I use As relation in my <code>Entities</code></p>
  
  <pre><code>@Entity
  @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
  public class Variant extends GenericDictionary&lt;Variant&gt; {}
  
  @Entity
  @Table(name="mi__Liability_Part_Hiv_Var")
  public class HivAndVHProtection_Variant extends Variant {
      @OneToMany public List&lt;HivAndVHProtection_VariantValue&gt; hivAndVHProtection_VariantValue = new LinkedList&lt;HivAndVHProtection_VariantValue&gt;();
  }
  
  @Entity
  @Table(name="mi__Liability_Part_Legal_Var")
  public class LegalExpensesInsurance_Variant extends GenericDictionary&lt;LegalExpensesInsurance_Variant&gt; {
      @OneToMany private List&lt;LegalExpensesInsurance_VariantValue&gt; legalExpensesInsurance_VariantValues = new LinkedList&lt;LegalExpensesInsurance_VariantValue&gt;();
  }
  </code></pre>
  
  <p>All of this <code>Variant</code> like classes extends superclass <code>Variant</code></p>
  
  <p>I've tried also:
      <code>@OneToOne public Class&lt;? extends Variant&gt; variant;</code>
  but getting an error:</p>
  
  <pre><code>Caused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on myInsurance.models.liability.hivAndVHProtection.Hiv_Answer.variant references an unknown entity: java.lang.Class
  </code></pre>