<html>
<head>
<title>WEB-INF/classes/example/CourseBean.java</title>
<style type='text/css'>
  .code-highlight { color: #1764FF; }
  .face-xmlelement { color: #003DB8; font-weight: bold }
</style>
</head>
<body bgcolor=white>
<code><b>WEB-INF/classes/example/CourseBean.java</b></code><p>
<pre>package example;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * Local interface for a course taught at Hogwarts, providing
 * methods to view and change it.
 *
 * &lt;code&gt;&lt;pre&gt;
 * CREATE TABLE ejb3_basic_courses (
 *   id INTEGER
 *   course VARCHAR(250),
 *   teacher VARCHAR(250),
 * 
 *   PRIMARY KEY(course_id)
 * );
 * &lt;/pre&gt;&lt;/code&gt;
 */
@Entity
@Table(name="ejb3_basic_courses")
public class CourseBean {
  private int _id;
  private String _course;
  private String _teacher;
  
  /**
   * Returns the ID of the course.
   */
  @Id
  @Column(name="id")
  @GeneratedValue
  public int getId()
  {
    return _id;
  }
  
  public void setId(int id)
  {
    _id = id;
  }

  /**
   * Returns the course name.
   */
  @Basic
  public String getCourse()
  {
    return _course;
  }

  /**
   * Sets the course name.
   */
  public void setCourse(String course)
  {
    _course = course;
  }

  /**
   * Returns the teacher name.
   */
  @Basic
  public String getTeacher()
  {
    return _teacher;
  }

  /**
   * Sets the teacher name.
   */
  public void setTeacher(String teacher)
  {
    _teacher = teacher;
  }
}
</pre>
</body>
</html>
