KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > example > cmp > transaction > Course


1 package example.cmp.transaction;
2
3 import javax.ejb.*;
4 import java.util.Collection;
5
6 /**
7  * Local interface for the Course bean.
8  * The Local Interface represents one entity; in this case a <code>Course
9  * </code>.
10  *
11  * <p>The idea is that you use the Home Interface to obtain references
12  * to whatever entities you're interested in. Each entity that you
13  * get from the Home Interface (using its create or finder methods)
14  * is then represented by its Local Interface.
15  *
16  */

17 public interface Course extends EJBLocalObject {
18
19   /**
20    * Returns the ID of this course (CMP field). This is also the primary key.
21    */

22   public int getId();
23
24   /**
25    * Get the ID of the course (CMP field).
26    */

27   public String getName();
28
29   /**
30    * Returns a <code>Collection</code> of all Students who are currently
31    * enrolled in this Course (CMR field).
32    */

33   public Collection getStudentList();
34
35   /**
36    * Returns true if the course is full and no more students can enroll in it.
37    */

38   public boolean isFull();
39
40 }
41
Popular Tags