example.cmp.select
Class StudentBean
example.cmp.select.StudentBean
- public abstract class StudentBean
Implementation class for the Student bean.
CREATE TABLE select_student (
name VARCHAR(250) NOT NULL,
gender VARCHAR(6) NOT NULL,
house VARCHAR(250) NOT NULL,
PRIMARY KEY(name)
);
StudentBean is abstract since it's taking advantage of container-managed
persistence. Resin-CMP will create the implementation of the abstract
methods.
StudentBean also takes advantage of the AbstractEntityBean
implementation. AbstractEntityBean is just a stub
EntityBean implementation with default methods to make life
a little more sane for simple beans.
Method Summary |
abstract java.lang.String |
getGender()
Returns the gender of the student (CMP field). |
abstract House |
getHouse()
returns the House that this Student belongs to (CMR field). |
abstract java.lang.String |
getName()
Returns the name of the student (CMP field). |
abstract void |
setGender(java.lang.String gender)
Sets the gender of the student (CMP field). |
abstract void |
setHouse(House house)
sets the House that this Student is to belong to (CMR field). |
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 as defined in the deployment descriptor.
getGender
public abstract java.lang.String getGender()
- Returns the gender of the student (CMP field).
setGender
public abstract void setGender(java.lang.String gender)
- Sets the gender of the student (CMP field).
getHouse
public abstract House getHouse()
- returns the
House
that this Student belongs to (CMR field).
setHouse
public abstract void setHouse(House house)
- sets the
House
that this Student is to belong to (CMR field).
- Parameters:
house
- new House that this Student will belong to.