title: JPA - Changing the Name of the mappedBy column
body: <p>Okay I have an application that maps Semesters to their courses;</p>
  
  <pre><code>public class Course {
  
      private String courseId;
      private String courseName;
  
      private Collection&lt;Semester&gt; semesters = new ArrayList&lt;&gt;();
  
      @OneToMany(targetEntity = Semester.class, mappedBy = "course")
      public Collection&lt;Semester&gt; getSemesters() {
          return semesters;
      }
  
      public void setSemesters(Collection&lt;Semester&gt; semesters) {
          this.semesters = semesters;
      }
  
      @Id
      @Column (name = "COURSE_ID")
      public String getCourseId() {
          return courseId;
      }
  
      public void setCourseId(String courseId) {
          this.courseId = courseId;
      }
  
      @Column(name = "COURSE_NAME", nullable = false, unique = true)
      public String getCourseName() {
          return courseName;
      }
  
      public void setCourseName(String courseName) {
          this.courseName = courseName;
      }
  }
  </code></pre>
  
  <p>As you can see the users class is mapped to the Semesters entity using One to Many mapping.</p>
  
  <p>The Semester class is as follows;</p>
  
  <pre><code>@Entity
  @Table (name = "SEMESTERS")
  public class Semester {
  
      private int semNum;
      private Course course;
  
      @ManyToOne
      public Course getCourse() {
          return course;
      }
  
      public void setCourse(Course course) {
          this.course = course;
      }
  
      @Id
      @Column (name = "SEM_NUM")
      public int getSemNum() {
          return semNum;
      }
  
      public void setSemNum(int semNum) {
          this.semNum = semNum;
      }
  }
  </code></pre>
  
  <p>As you can see I am using <code>mappedBy</code> to map the course directly into the semester table. But the problem is that the field in the semester table comes as <code>course_COURSE_ID</code>.</p>
  
  <p>How can I change this column name to just <code>COURSE_ID</code> ?</p>