KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > rice > rubis > beans > CommentLocalHome


1 package edu.rice.rubis.beans;
2
3 import java.rmi.RemoteException JavaDoc;
4 import java.util.Collection JavaDoc;
5 import javax.ejb.CreateException JavaDoc;
6 import javax.ejb.EJBLocalHome JavaDoc;
7 import javax.ejb.FinderException JavaDoc;
8 import javax.ejb.RemoveException JavaDoc;
9
10 /** This is the Local Home interface of the Comment Bean */
11
12 public interface CommentLocalHome extends EJBLocalHome JavaDoc {
13   /**
14    * This method is used to create a new Comment Bean.
15    * The date is automatically set to the current date when the method is called.
16    *
17    * @param FromUserId user id of the comment author, must match the primary key of table users
18    * @param ToUserId user id of the user this comment is about, must match the primary key of table users
19    * @param ItemId item id, must match the primary key of table items
20    * @param Rating user (ToUserId) rating given by the author (FromUserId)
21    * @param Comment comment text
22    *
23    * @return pk primary key set to null
24    */

25   public CommentLocal create(Integer JavaDoc FromUserId, Integer JavaDoc ToUserId, Integer JavaDoc ItemId, int Rating, String JavaDoc Comment) throws CreateException JavaDoc, RemoveException JavaDoc;
26
27   /**
28    * This method is used to retrieve a Comment Bean from its primary key,
29    * that is to say its id.
30    *
31    * @param id Comment id (primary key)
32    *
33    * @return the Comment if found else null
34    */

35   public CommentLocal findByPrimaryKey(CommentPK id) throws FinderException JavaDoc;
36
37   /**
38    * This method is used to retrieve all Comment Beans related to one item.
39    * You must provide the item id.
40    *
41    * @param id item id
42    *
43    * @return List of Comments found (eventually empty)
44    */

45   public Collection JavaDoc findByItem(Integer JavaDoc id) throws FinderException JavaDoc;
46
47   /**
48    * This method is used to retrieve all Comment Beans belonging to
49    * a specific author. You must provide the author user id.
50    *
51    * @param id user id
52    *
53    * @return List of Comments found (eventually empty)
54    */

55   public Collection JavaDoc findByFromUser(Integer JavaDoc id) throws FinderException JavaDoc;
56
57   /**
58    * This method is used to retrieve all Comment Beans related to
59    * a specific user. You must provide the user id.
60    *
61    * @param id user id
62    *
63    * @return List of Comments found (eventually empty)
64    */

65   public Collection JavaDoc findByToUser(Integer JavaDoc id) throws FinderException JavaDoc;
66
67   /**
68    * This method is used to retrieve all comments from the database!
69    *
70    * @return List of all comments (eventually empty)
71    */

72   public Collection JavaDoc findAllComments() throws FinderException JavaDoc;
73 }
74
Popular Tags