example.cmp.many2many
Class StudentBean
example.cmp.many2many.StudentBean
- public abstract class StudentBean
Implementation class for the Student bean.
This CMP bean uses the following schema:
CREATE TABLE many2many_students (
name VARCHAR(250) NOT NULL,
PRIMARY KEY(name)
);
Method Summary |
void |
addCourse(Course course)
a little helper to enroll students in a Course |
abstract java.util.Collection |
getCourseList()
returns a Collection of all Course s the
Student is currently enrolled in. |
abstract java.lang.String |
getName()
Returns the name of the student (CMP field). |
void |
removeCourse(Course course)
a little helper to drop a Course |
StudentBean
public StudentBean()
getName
public abstract java.lang.String getName()
- Returns the name of the student (CMP field).
The name is also the primary key.
getCourseList
public abstract java.util.Collection getCourseList()
- returns a
Collection
of all Course
s the
Student
is currently enrolled in.
addCourse
public void addCourse(Course course)
- a little helper to enroll students in a
Course
removeCourse
public void removeCourse(Course course)
- a little helper to drop a
Course