edu.rice.rubis.beans
Interface ItemHome

All Superinterfaces:
javax.ejb.EJBHome, java.rmi.Remote

public interface ItemHome
extends javax.ejb.EJBHome

This is the Home interface of the Item Bean


Method Summary
 Item create(java.lang.String itemName, java.lang.String itemDescription, float itemInitialPrice, int itemQuantity, float itemReservePrice, float itemBuyNow, int duration, java.lang.Integer itemSellerId, java.lang.Integer itemCategoryId)
          This method is used to create a new Item Bean.
 java.util.Collection findAllItems()
          This method is used to retrieve all items from the database!
 java.util.Collection findByCategory(java.lang.Integer id)
          This method is used to retrieve all Item Beans belonging to a specific category.
 Item findByPrimaryKey(ItemPK id)
          This method is used to retrieve an Item Bean from its primary key, that is to say its id.
 java.util.Collection findBySeller(java.lang.Integer id)
          This method is used to retrieve all Item Beans belonging to a seller.
 java.util.Collection findCurrentByCategory(java.lang.Integer id)
          This method is used to retrieve Item Beans belonging to a specific category that are still to sell (auction end date is not passed).
 java.util.Collection findUserCurrentSellings(java.lang.Integer userId)
          Get all the items the user is currently selling.
 java.util.Collection findUserPastSellings(java.lang.Integer userId)
          Get all the items the user sold in the last 30 days.
 
Methods inherited from interface javax.ejb.EJBHome
getEJBMetaData, getHomeHandle, remove, remove
 

Method Detail

create

public Item create(java.lang.String itemName,
                   java.lang.String itemDescription,
                   float itemInitialPrice,
                   int itemQuantity,
                   float itemReservePrice,
                   float itemBuyNow,
                   int duration,
                   java.lang.Integer itemSellerId,
                   java.lang.Integer itemCategoryId)
            throws javax.ejb.CreateException,
                   java.rmi.RemoteException,
                   javax.ejb.RemoveException
This method is used to create a new Item Bean. Note that the item id is automatically generated by the database (AUTO_INCREMENT) on the primary key.
Parameters:
itemName - short item designation
itemDescription - long item description, usually an HTML file
itemInitialPrice - initial price fixed by the seller
itemQuantity - number to sell (of this item)
itemReservePrice - reserve price (minimum price the seller really wants to sell)
itemBuyNow - price if a user wants to buy the item immediatly
duration - duration of the auction in days (start date is when the method is called and end date is computed according to the duration)
itemSellerId - seller id, must match the primary key of table users
itemCategoryId - category id, must match the primary key of table categories
Returns:
pk primary key set to null

findByPrimaryKey

public Item findByPrimaryKey(ItemPK id)
                      throws javax.ejb.FinderException,
                             java.rmi.RemoteException
This method is used to retrieve an Item Bean from its primary key, that is to say its id.
Parameters:
id - Item id (primary key)
Returns:
the Item if found else null

findBySeller

public java.util.Collection findBySeller(java.lang.Integer id)
                                  throws java.rmi.RemoteException,
                                         javax.ejb.FinderException
This method is used to retrieve all Item Beans belonging to a seller. You must provide the user id of the seller.
Parameters:
id - User id of the seller
Returns:
List of Items found (eventually empty)

findByCategory

public java.util.Collection findByCategory(java.lang.Integer id)
                                    throws java.rmi.RemoteException,
                                           javax.ejb.FinderException
This method is used to retrieve all Item Beans belonging to a specific category. You must provide the category id.
Parameters:
id - Category id
Returns:
List of Items found (eventually empty)

findCurrentByCategory

public java.util.Collection findCurrentByCategory(java.lang.Integer id)
                                           throws java.rmi.RemoteException,
                                                  javax.ejb.FinderException
This method is used to retrieve Item Beans belonging to a specific category that are still to sell (auction end date is not passed). You must provide the category id.
Parameters:
id - Category id
Returns:
List of Items found (eventually empty)

findUserCurrentSellings

public java.util.Collection findUserCurrentSellings(java.lang.Integer userId)
                                             throws java.rmi.RemoteException,
                                                    javax.ejb.FinderException
Get all the items the user is currently selling.
Parameters:
userId - user id
Returns:
Vector of items primary keys (can be less than maxToCollect)
Throws:
java.rmi.RemoteException - if an error occurs

findUserPastSellings

public java.util.Collection findUserPastSellings(java.lang.Integer userId)
                                          throws java.rmi.RemoteException,
                                                 javax.ejb.FinderException
Get all the items the user sold in the last 30 days.
Parameters:
userId - user id
Returns:
Vector of items primary keys (can be less than maxToCollect)
Throws:
java.rmi.RemoteException - if an error occurs

findAllItems

public java.util.Collection findAllItems()
                                  throws java.rmi.RemoteException,
                                         javax.ejb.FinderException
This method is used to retrieve all items from the database!
Returns:
List of all items (eventually empty)


Copyright © 2003 - ObjectWeb Consortium - All Rights Reserved.