KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

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

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

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

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

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

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

104   public Collection JavaDoc findAllOldItems() throws FinderException JavaDoc;
105 }
106
Popular Tags