edu.rice.rubis.beans
Interface ItemLocalHome

All Superinterfaces:
javax.ejb.EJBLocalHome

public interface ItemLocalHome
extends javax.ejb.EJBLocalHome

This is the LocalHome interface of the Item Bean


Method Summary
 ItemLocal 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.
 ItemLocal 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.EJBLocalHome
remove
 

Method Detail

create

public ItemLocal 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,
                        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 ItemLocal findByPrimaryKey(ItemPK id)
                           throws javax.ejb.FinderException
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 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 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 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 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)

findUserPastSellings

public java.util.Collection findUserPastSellings(java.lang.Integer userId)
                                          throws 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)

findAllItems

public java.util.Collection findAllItems()
                                  throws 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.