KickJava   Java API By Example, From Geeks To Geeks.

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


1 package edu.rice.rubis.beans;
2
3 import javax.ejb.CreateException JavaDoc;
4 import javax.ejb.EJBHome JavaDoc;
5 import javax.ejb.FinderException JavaDoc;
6 import javax.ejb.RemoveException JavaDoc;
7 import java.rmi.RemoteException JavaDoc;
8 import java.util.Collection JavaDoc;
9
10 /** This is the Home interface of the Category Bean */
11
12 public interface CategoryHome extends EJBHome JavaDoc {
13
14   /**
15    * This method is used to create a new Category Bean. Note that the category
16    * id is automatically generated by the database (AUTO_INCREMENT) on the
17    * primary key.
18    *
19    * @param name Category name
20    *
21    * @return pk primary key set to null
22    */

23   public Category create(String JavaDoc name) throws CreateException JavaDoc, RemoteException JavaDoc, RemoveException JavaDoc;
24
25
26   /**
27    * This method is used to retrieve a Category Bean from its primary key,
28    * that is to say its id.
29    *
30    * @param id Category id (primary key)
31    *
32    * @return the Category if found else null
33    */

34   public Category findByPrimaryKey(CategoryPK id) throws FinderException JavaDoc, RemoteException JavaDoc;
35
36
37   /**
38    * This method is used to retrieve a Category Bean from its name.
39    *
40    * @param categoryName Category name
41    *
42    * @return the Category if found else null
43    */

44   public Category findByName(String JavaDoc categoryName) throws FinderException JavaDoc, RemoteException JavaDoc;
45
46
47   /**
48    * This method is used to retrieve all categories from the database!
49    *
50    * @return List of all categories (eventually empty)
51    */

52   public Collection JavaDoc findAllCategories() throws RemoteException JavaDoc, FinderException JavaDoc;
53 }
54
Popular Tags