edu.rice.rubis.beans
Interface BuyNowHome

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

public interface BuyNowHome
extends javax.ejb.EJBHome

This is the Home interface of the BuyNow Bean

Version:
1.0
Author:
Emmanuel Cecchet and Julie Marguerite

Method Summary
 BuyNow 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.
 BuyNow 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.EJBHome
getEJBMetaData, getHomeHandle, remove, remove
 

Method Detail

create

public BuyNow create(java.lang.Integer BuyNowUserId,
                     java.lang.Integer BuyNowItemId,
                     int quantity)
              throws javax.ejb.CreateException,
                     java.rmi.RemoteException,
                     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
java.rmi.RemoteException - if an error occurs
javax.ejb.RemoveException - if an error occurs

findByPrimaryKey

public BuyNow findByPrimaryKey(BuyNowPK id)
                        throws javax.ejb.FinderException,
                               java.rmi.RemoteException
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
java.rmi.RemoteException - if an error occurs

findByItem

public java.util.Collection findByItem(java.lang.Integer id)
                                throws javax.ejb.FinderException,
                                       java.rmi.RemoteException
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
java.rmi.RemoteException - if an error occurs

findByUser

public java.util.Collection findByUser(java.lang.Integer id)
                                throws javax.ejb.FinderException,
                                       java.rmi.RemoteException
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
java.rmi.RemoteException - if an error occurs

findAllBuyNows

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

findUserBuyNow

public java.util.Collection findUserBuyNow(java.lang.Integer userId)
                                    throws java.rmi.RemoteException,
                                           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)
Throws:
java.rmi.RemoteException - if an error occurs


Copyright © 2003 - ObjectWeb Consortium - All Rights Reserved.