KickJava   Java API By Example, From Geeks To Geeks.

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


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 LocalHome interface of the Item Bean */
11
12 public interface ItemLocalHome extends EJBLocalHome JavaDoc {
13   /**
14    * This method is used to create a new Item Bean. Note that the item id
15    * is automatically generated by the database (AUTO_INCREMENT) on the
16    * primary key.
17    *
18    * @param itemName short item designation
19    * @param itemDescription long item description, usually an HTML file
20    * @param itemInitialPrice initial price fixed by the seller
21    * @param itemQuantity number to sell (of this item)
22    * @param itemReservePrice reserve price (minimum price the seller really wants to sell)
23    * @param itemBuyNow price if a user wants to buy the item immediatly
24    * @param duration duration of the auction in days (start date is when the method is called and end date is computed according to the duration)
25    * @param itemSellerId seller id, must match the primary key of table users
26    * @param itemCategoryId category id, must match the primary key of table categories
27    *
28    * @return pk primary key set to null
29    */

30   public ItemLocal create(String JavaDoc itemName, String JavaDoc itemDescription, float itemInitialPrice,
31                      int itemQuantity, float itemReservePrice, float itemBuyNow, int duration,
32                      Integer JavaDoc itemSellerId, Integer JavaDoc itemCategoryId) throws CreateException JavaDoc, RemoveException JavaDoc;
33
34
35   /**
36    * This method is used to retrieve an Item Bean from its primary key,
37    * that is to say its id.
38    *
39    * @param id Item id (primary key)
40    *
41    * @return the Item if found else null
42    */

43   public ItemLocal findByPrimaryKey(ItemPK id) throws FinderException JavaDoc;
44
45
46   /**
47    * This method is used to retrieve all Item Beans belonging to
48    * a seller. You must provide the user id of the seller.
49    *
50    * @param id User id of the seller
51    *
52    * @return List of Items found (eventually empty)
53    */

54   public Collection JavaDoc findBySeller(Integer JavaDoc id) throws FinderException JavaDoc;
55
56   /**
57    * This method is used to retrieve all Item Beans belonging to
58    * a specific category. You must provide the category id.
59    *
60    * @param id Category id
61    *
62    * @return List of Items found (eventually empty)
63    */

64   public Collection JavaDoc findByCategory(Integer JavaDoc id) throws FinderException JavaDoc;
65
66
67   /**
68    * This method is used to retrieve Item Beans belonging to a specific category
69    * that are still to sell (auction end date is not passed).
70    * You must provide the category id.
71    *
72    * @param id Category id
73    *
74    * @return List of Items found (eventually empty)
75    */

76   public Collection JavaDoc findCurrentByCategory(Integer JavaDoc id) throws FinderException JavaDoc;
77
78
79   /**
80    * Get all the items the user is currently selling.
81    *
82    * @param userId user id
83    *
84    * @return Vector of items primary keys (can be less than maxToCollect)
85    */

86   public Collection JavaDoc findUserCurrentSellings(Integer JavaDoc userId) throws FinderException JavaDoc;
87
88
89  /**
90    * Get all the items the user sold in the last 30 days.
91    *
92    * @param userId user id
93    *
94    * @return Vector of items primary keys (can be less than maxToCollect)
95    */

96     public Collection JavaDoc findUserPastSellings(Integer JavaDoc userId) throws FinderException JavaDoc;
97
98   /**
99    * This method is used to retrieve all items from the database!
100    *
101    * @return List of all items (eventually empty)
102    */

103   public Collection JavaDoc findAllItems() throws FinderException JavaDoc;
104 }
105
Popular Tags