title: Hibernate mapping - "Could not determine type"
body: <p>I currently have the following objects persisting successfully:</p>
  
  <ul>
  <li><strong>Person</strong> first name, etc.</li>
  <li><strong>Exams</strong> title, date, etc.</li>
  </ul>
  
  <p>I'd like to now create a third table <strong>Exam results</strong>. For this table I believe it should be person ID, exam ID and result, and this is a many to many relationship.</p>
  
  <pre><code>@Entity
  public class ExamResult {
      private Exam exam;
      private Person person;
      private double value;
  
      @Id
      @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )
      @JoinColumn(name="EXAM_ID")
      public Exam getExam() {
          return exam;
      }
      public void setExam(Exam exam) {
          this.exam = exam;
      }
  
      @Id
      @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )
      @JoinColumn(name="PERSON_ID")
      public Person getPerson() {
          return person;
      }
      public void setPerson(Person person) {
          this.person = person;
      }
  
      public double getValue() {
          return value;
      }
      public void setValue(double value) {
          this.value = value;
      }
  }
  </code></pre>
  
  <p>The error:</p>
  
  <blockquote>
    <blockquote>
      <p>org.hibernate.MappingException: Could not determine type for: Person, at table: ExamResult, for columns: [org.hibernate.mapping.Column(person)]</p>
    </blockquote>
  </blockquote>
  
  <p>I think I may be going about this the wrong way, but I can't work out how to proceed with this relationship from the
  <a href="http://docs.jboss.org/hibernate/stable/annotations/reference/en/html/entity.html" rel="noreferrer">tutorial</a>.</p>
  
  <p>Any ideas?</p>