edu.rice.rubis.beans
Interface BuyNowLocalHome

All Superinterfaces:
javax.ejb.EJBLocalHome

public interface BuyNowLocalHome
extends javax.ejb.EJBLocalHome

This is the Local Home interface of the BuyNow Bean

Version:
1.0
Author:
Emmanuel Cecchet and Julie Marguerite

Method Summary
 BuyNowLocal create(java.lang.Integer BuyNowUserId, java.lang.Integer BuyNowItemId, int quantity)
          This method is used to create a new BuyNow Bean.
 java.util.Collection findAllBuyNows()
          This method is used to retrieve all BuyNows from the database!
 java.util.Collection findByItem(java.lang.Integer id)
          This method is used to retrieve all BuyNow Beans related to one item.
 BuyNowLocal findByPrimaryKey(BuyNowPK id)
          This method is used to retrieve a BuyNow Bean from its primary key, that is to say its id.
 java.util.Collection findByUser(java.lang.Integer id)
          This method is used to retrieve all BuyNow Beans belonging to a specific user.
 java.util.Collection findUserBuyNow(java.lang.Integer userId)
          Get all the items the user bought using the buy-now option in the last 30 days.
 
Methods inherited from interface javax.ejb.EJBLocalHome
remove
 

Method Detail

create

public BuyNowLocal create(java.lang.Integer BuyNowUserId,
                          java.lang.Integer BuyNowItemId,
                          int quantity)
                   throws javax.ejb.CreateException,
                          javax.ejb.RemoveException
This method is used to create a new BuyNow Bean. The date is automatically set to the current date when the method is called.
Parameters:
BuyNowUserId - user id of the buyer, must match the primary key of table users
BuyNowItemId - item id, must match the primary key of table items
quantity - number of items the user wants to buy
Returns:
pk primary key set to null
Throws:
javax.ejb.CreateException - if an error occurs
javax.ejb.RemoveException - if an error occurs

findByPrimaryKey

public BuyNowLocal findByPrimaryKey(BuyNowPK id)
                             throws javax.ejb.FinderException
This method is used to retrieve a BuyNow Bean from its primary key, that is to say its id.
Parameters:
id - BuyNow id (primary key)
Returns:
the BuyNow if found else null
Throws:
javax.ejb.FinderException - if an error occurs

findByItem

public java.util.Collection findByItem(java.lang.Integer id)
                                throws javax.ejb.FinderException
This method is used to retrieve all BuyNow Beans related to one item. You must provide the item id.
Parameters:
id - item id
Returns:
List of BuyNows found (eventually empty)
Throws:
javax.ejb.FinderException - if an error occurs

findByUser

public java.util.Collection findByUser(java.lang.Integer id)
                                throws javax.ejb.FinderException
This method is used to retrieve all BuyNow Beans belonging to a specific user. You must provide the user id.
Parameters:
id - user id
Returns:
List of BuyNows found (eventually empty)
Throws:
javax.ejb.FinderException - if an error occurs

findAllBuyNows

public java.util.Collection findAllBuyNows()
                                    throws javax.ejb.FinderException
This method is used to retrieve all BuyNows from the database!
Returns:
List of all BuyNows (eventually empty)
Throws:
javax.ejb.FinderException - if an error occurs

findUserBuyNow

public java.util.Collection findUserBuyNow(java.lang.Integer userId)
                                    throws javax.ejb.FinderException
Get all the items the user bought using the buy-now option in the last 30 days.
Parameters:
userId - user id
Returns:
Vector of items primary keys (can be less than maxToCollect)


Copyright © 2003 - ObjectWeb Consortium - All Rights Reserved.