edu.rice.rubis.beans
Interface OldItemLocalHome

All Superinterfaces:
javax.ejb.EJBLocalHome

public interface OldItemLocalHome
extends javax.ejb.EJBLocalHome

This is the Local Home interface of the Old Item Bean


Method Summary
 OldItemLocal create(java.lang.Integer itemId, 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 Old Item Bean.
 java.util.Collection findAllOldItems()
          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 OldItem Beans belonging to a specific category.
 OldItemLocal findByPrimaryKey(OldItemPK id)
          This method is used to retrieve an Old 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 OldItem Beans belonging to a seller.
 java.util.Collection findCurrentByCategory(java.lang.Integer id)
          This method is used to retrieve OldItem 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 OldItemLocal create(java.lang.Integer itemId,
                           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 Old Item Bean. Note that the item id is automatically generated by the database (AUTO_INCREMENT) on the primary key.
Parameters:
itemId - item identifier
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:
the Old Item

findByPrimaryKey

public OldItemLocal findByPrimaryKey(OldItemPK id)
                              throws javax.ejb.FinderException
This method is used to retrieve an Old Item Bean from its primary key, that is to say its id.
Parameters:
id - Old Item id (primary key)
Returns:
the Old 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 OldItem Beans belonging to a seller. You must provide the user id of the seller.
Parameters:
id - User id of the seller
Returns:
List of OldItems found (eventually empty)

findByCategory

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

findCurrentByCategory

public java.util.Collection findCurrentByCategory(java.lang.Integer id)
                                           throws javax.ejb.FinderException
This method is used to retrieve OldItem 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 OldItems 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)

findAllOldItems

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