|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
example.cmp.find.CourseBean
Implementation class for the Course bean.
Its methods will be called only by the EJB container, and not ever by any client programs that we write. Instead, we call methods in the Remote Interface which will prompt the container to access methods in this class on our behalf. The container will also call the various housekeeping methods described below when it sees fit.
This CMP bean uses the following schema:
The implementation class for the Course bean. Its methods will be
called only by the EJB container, and not by the client programs.
The client calls methods in the local interface (Course) which will
use the Resin-CMP-generated stub to access methods in this class
on our behalf.
DROP TABLE find_courses;
CREATE TABLE find_courses (
course_id VARCHAR(250) NOT NULL,
instructor VARCHAR(250),
PRIMARY KEY(course_id)
);
INSERT INTO find_courses VALUES('Potions', 'Severus Snape');
INSERT INTO find_courses VALUES('Transfiguration', 'Minerva McGonagall');
INSERT INTO find_courses VALUES('Defense Against the Dark Arts', 'Remus Lupin');
Constructor Summary | |
CourseBean()
|
Method Summary | |
abstract java.lang.String |
getCourseId()
Returns the id (and name) of this course (CMP field). |
abstract java.lang.String |
getInstructor()
returns the name of the instructor who is teaching this course (CMP field). |
abstract void |
setCourseId(java.lang.String courseId)
Sets the id (and name) of this course (CMP field). |
abstract void |
setInstructor(java.lang.String instructor)
Sets the name of the instructor who is teaching this course (CMP field). |
Constructor Detail |
public CourseBean()
Method Detail |
public abstract java.lang.String getCourseId()
Each cmp-field described in the deployment descriptor needs to be matched in the implementation class by abstract setXXX and getXXX methods. The container will take care of implementing them.
Unless you make these methods available in the Local Interface, you will never be able to access them from an EJB client such as a servlet.
Resin-CMP will implement the getCourseId method.
public abstract void setCourseId(java.lang.String courseId)
Resin-CMP will implement the setCourseId methods.
courseId
- the new course idjavax.ejb.EJBException
- if the database call or the transaction fails.public abstract java.lang.String getInstructor()
Resin-CMP will implement the getCourseId method.
javax.ejb.EJBException
- if the database call or the transaction fails.public abstract void setInstructor(java.lang.String instructor)
Resin-CMP will implement the getCourseId method.
instructor
- the name of the new course instructor.javax.ejb.EJBException
- if the database call or the transaction fails.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |