KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
11  * This is the Local 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 BuyNowLocalHome extends EJBLocalHome 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 RemoveException if an error occurs
27    */

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

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

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

61   public Collection JavaDoc findByUser(Integer JavaDoc id) throws FinderException JavaDoc;
62
63   /**
64    * This method is used to retrieve all BuyNows from the database!
65    *
66    * @return List of all BuyNows (eventually empty)
67    * @exception FinderException if an error occurs
68    */

69   public Collection JavaDoc findAllBuyNows() throws FinderException JavaDoc;
70
71   /**
72    * Get all the items the user bought using the buy-now option in the last 30 days.
73    *
74    * @param userId user id
75    *
76    * @return Vector of items primary keys (can be less than maxToCollect)
77    */

78     public Collection JavaDoc findUserBuyNow(Integer JavaDoc userId) throws FinderException JavaDoc;
79
80 }
81
Popular Tags