title: @OneToMany annotation- SQLSyntaxErrorException: ORA-00904 invalid identifier
body: <p>What I am trying to do is to combine <code>emplid</code> of <code>PsStudMajor</code> into <code>PsMajor</code> so that I may just call <code>PsMajor</code> model with <code>emplid</code> in it.</p>
  
  <p>After adding these codes of annotation into my project, it does not work anymore.
  See below</p>
  
  <pre><code>public class PsStudMajor {
  
      @EmbeddedId   
      private PsStudMajorKey id;   
  
      @OneToMany(fetch=FetchType.EAGER, mappedBy="psStudMajor")  
      private Set&lt;PsMajor&gt; psMajor;
  
      public Set&lt;PsMajor&gt; getPsMajor() {
          return this.psMajor;
      }
  }
  
  public class PsMajor {
  
      @EmbeddedId  
      private PsMajorKey id;
  
      @ManyToOne(fetch=FetchType.EAGER)   
      private PsStudMajor psStudMajor;
  
      public PsStudMajor getPsStudMajor() {
          return this.psStudMajor;
      }
  }
  </code></pre>
  
  <p>However, if I comment these codes out, it works.</p>
  
  <p>Here are the attributes from key model</p>
  
  <pre><code>public class PsMajorKey {
  
      @Column (name = "acad_plan")
      private String major;
  
      @Column (name = "descr")
      private String descr;
  }
  
  public class PsStudMajorKey {
  
      @Column (name = "emplid")
      private String emplid;
  
      @Column (name = "acad_plan")
      private String major;
  
      @Column (name = "effdt")
      private String lastDate;
  }
  </code></pre>
  
  <p>Here is the error message:</p>
  
  <blockquote>
    <p>java.sql.SQLSyntaxErrorException: ORA-00904: "PSMAJOR1_"."PSSTUDMAJOR_ACAD_PLAN": invalid identifier</p>
  </blockquote>
  
  <p>I have no idea where goes wrong.</p>
  
  <p>May someone give me some suggestions!? 
  Thanks!</p>