example.cmp.create
Interface CourseHome

All Superinterfaces:
javax.ejb.EJBLocalHome

public interface CourseHome
extends javax.ejb.EJBLocalHome

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

findByPrimaryKey

public Course findByPrimaryKey(java.lang.String courseId)
                        throws javax.ejb.FinderException
returns the 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.
Parameters:
courseId - id and name of the course that is to be retreived

findAll

public java.util.Collection findAll()
                             throws javax.ejb.FinderException
returns a Collection of all courses.

create

public Course create(java.lang.String courseId,
                     java.lang.String instructor)
              throws javax.ejb.CreateException
create a new course entity-

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.