|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Home interface for the Course bean. The Home Interface enables you to create new entities and to obtain references to existing ones.
The idea is that you use the Home Interface to obtain references to whatever entities you're interested in. Each entity that you get from the Home Interface (using its create or finder methods) is then represented by its Remote Interface.
With this Remote Interface, you can obtain information about a particular course, but you cannot change it. The Remote Interface is your only point of access to an entity, and there are no setXXX methods in this example.
Method Summary | |
Course |
create(java.lang.String courseId,
java.lang.String instructor)
create a new course entity- create methods. |
java.util.Collection |
findAll()
returns a Collection of all courses. |
Course |
findByPrimaryKey(java.lang.String courseId)
returns the Course that has courseId
as its primary key. |
Methods inherited from interface javax.ejb.EJBLocalHome |
remove |
Method Detail |
public Course findByPrimaryKey(java.lang.String courseId) throws javax.ejb.FinderException
Course
that has courseId
as its primary key.
Every entity EJB needs to have a finder method that returns an entity
based on the primary key.courseId
- id and name of the course that is to be retreivedpublic java.util.Collection findAll() throws javax.ejb.FinderException
Collection
of all courses.public Course create(java.lang.String courseId, java.lang.String instructor) throws javax.ejb.CreateException
create methods. The container will implement
the create
methods for us, based on code that we write in
our implementation class (CourseHome.java). For each create
method in this home interface, there needs to be a corresponding
ejbCreate
method in CourseHome.java that has the same
parameters and doesn't throw CreateException
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |