example.cmp.one2many
Interface House

All Superinterfaces:
javax.ejb.EJBLocalObject

public interface House
extends javax.ejb.EJBLocalObject

Local interface for the House bean.


Method Summary
 void addStudent(Student student)
          Adds a student to the house.
 java.lang.String getName()
          returns the name of the house (CMP field).
 java.util.Collection getStudentList()
          returns a list of all students living in this house (CMR field).
 void removeStudent(Student student)
          Removes a student from the house.
 
Methods inherited from interface javax.ejb.EJBLocalObject
getEJBLocalHome, getPrimaryKey, isIdentical, remove
 

Method Detail

getName

public java.lang.String getName()
returns the name of the house (CMP field).

getStudentList

public java.util.Collection getStudentList()
returns a list of all students living in this house (CMR field).

addStudent

public void addStudent(Student student)
Adds a student to the house. If the student is already a member of another house, he will be removed from that house automatically.

removeStudent

public void removeStudent(Student student)
Removes a student from the house.