KickJava   Java API By Example, From Geeks To Geeks.

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


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.EJBHome JavaDoc;
7 import javax.ejb.FinderException JavaDoc;
8 import javax.ejb.RemoveException JavaDoc;
9
10 /**
11  * This is the Home interface of the BuyNow Bean
12  * @author <a HREF="mailto:cecchet@rice.edu">Emmanuel Cecchet</a> and <a HREF="mailto:julie.marguerite@inrialpes.fr">Julie Marguerite</a>
13  * @version 1.0
14  */

15 public interface BuyNowHome extends EJBHome JavaDoc {
16   /**
17    * This method is used to create a new BuyNow Bean.
18    * The date is automatically set to the current date when the method is called.
19    *
20    * @param BuyNowUserId user id of the buyer, must match the primary key of table users
21    * @param BuyNowItemId item id, must match the primary key of table items
22    * @param quantity number of items the user wants to buy
23    *
24    * @return pk primary key set to null
25    * @exception CreateException if an error occurs
26    * @exception RemoteException if an error occurs
27    * @exception RemoveException if an error occurs
28    */

29   public BuyNow create(Integer JavaDoc BuyNowUserId, Integer JavaDoc BuyNowItemId, int quantity) throws CreateException JavaDoc, RemoteException JavaDoc, RemoveException JavaDoc;
30
31   /**
32    * This method is used to retrieve a BuyNow Bean from its primary key,
33    * that is to say its id.
34    *
35    * @param id BuyNow id (primary key)
36    *
37    * @return the BuyNow if found else null
38    * @exception FinderException if an error occurs
39    * @exception RemoteException if an error occurs
40    */

41   public BuyNow findByPrimaryKey(BuyNowPK id) throws FinderException JavaDoc, RemoteException JavaDoc;
42
43   /**
44    * This method is used to retrieve all BuyNow Beans related to one item.
45    * You must provide the item id.
46    *
47    * @param id item id
48    *
49    * @return List of BuyNows found (eventually empty)
50    * @exception FinderException if an error occurs
51    * @exception RemoteException if an error occurs
52    */

53   public Collection JavaDoc findByItem(Integer JavaDoc id) throws FinderException JavaDoc, RemoteException JavaDoc;
54
55   /**
56    * This method is used to retrieve all BuyNow Beans belonging to
57    * a specific user. You must provide the user id.
58    *
59    * @param id user id
60    *
61    * @return List of BuyNows found (eventually empty)
62    * @exception FinderException if an error occurs
63    * @exception RemoteException if an error occurs
64    */

65   public Collection JavaDoc findByUser(Integer JavaDoc id) throws FinderException JavaDoc, RemoteException JavaDoc;
66
67   /**
68    * This method is used to retrieve all BuyNows from the database!
69    *
70    * @return List of all BuyNows (eventually empty)
71    * @exception RemoteException if an error occurs
72    * @exception FinderException if an error occurs
73    */

74   public Collection JavaDoc findAllBuyNows() throws RemoteException JavaDoc, FinderException JavaDoc;
75
76   /**
77    * Get all the items the user bought using the buy-now option in the last 30 days.
78    *
79    * @param userId user id
80    *
81    * @return Vector of items primary keys (can be less than maxToCollect)
82    * @exception RemoteException if an error occurs
83    */

84     public Collection JavaDoc findUserBuyNow(Integer JavaDoc userId) throws RemoteException JavaDoc, FinderException JavaDoc;
85
86 }
87
Popular Tags