KickJava   Java API By Example, From Geeks To Geeks.

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


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 Bid 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 BidHome extends EJBHome JavaDoc {
16   /**
17    * This method is used to create a new Bid Bean.
18    * The date is automatically set to the current date when the method is called.
19    *
20    * @param bidUserId user id of the bidder, must match the primary key of table users
21    * @param bidItemId item id, must match the primary key of table items
22    * @param userBid the amount of the user bid
23    * @param userMaxBid the maximum amount the user wants to bid
24    * @param quantity number of items the user wants to buy
25    *
26    * @return pk primary key set to null
27    * @exception CreateException if an error occurs
28    * @exception RemoteException if an error occurs
29    * @exception RemoveException if an error occurs
30    */

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

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

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

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

76   public Collection JavaDoc findAllBids() throws RemoteException JavaDoc, FinderException JavaDoc;
77 }
78
Popular Tags