example.cmp.map
Class GradeBean

example.cmp.map.GradeBean

public abstract class GradeBean

Implementation class for the Grade bean.

The Grade has a compound key with two identifying fields: the Student and the Course.

This CMP bean uses the following schema:

    CREATE TABLE map_grades (
     student VARCHAR(250) NOT NULL REFERENCES map_students(name),
     course VARCHAR(250) NOT NULL REFERENCES map_courses(name),

     grade VARCHAR(3),

     PRIMARY KEY(student, course)
   );
 


Constructor Summary
GradeBean()
           
 
Method Summary
 GradeKey ejbCreate(Student student, Course course, java.lang.String grade)
          Create a new grade object.
 void ejbPostCreate(Student student, Course course, java.lang.String grade)
          Create a new grade object.
abstract  Course getCourse()
          Returns the Grade's course.
abstract  java.lang.String getGrade()
          Returns the grade.
abstract  Student getStudent()
          Returns the Grade's student.
abstract  void setCourse(Course course)
          Sets the Grade's course.
abstract  void setGrade(java.lang.String grade)
          Sets the grade.
abstract  void setStudent(Student student)
          Sets the Grade's student.
 

Constructor Detail

GradeBean

public GradeBean()
Method Detail

getStudent

public abstract Student getStudent()
Returns the Grade's student. This is part of the primary key.

setStudent

public abstract void setStudent(Student student)
Sets the Grade's student. Since this is part of the primary key, it it only set in ejbCreate.

getCourse

public abstract Course getCourse()
Returns the Grade's course. This is part of the primary key.

setCourse

public abstract void setCourse(Course course)
Sets the Grade's course. Since this is part of the primary key, it it only set in ejbCreate.

getGrade

public abstract java.lang.String getGrade()
Returns the grade.

setGrade

public abstract void setGrade(java.lang.String grade)
Sets the grade.

ejbCreate

public GradeKey ejbCreate(Student student,
                          Course course,
                          java.lang.String grade)
                   throws javax.ejb.CreateException
Create a new grade object.

ejbPostCreate

public void ejbPostCreate(Student student,
                          Course course,
                          java.lang.String grade)
                   throws javax.ejb.CreateException
Create a new grade object.