FileDocCategorySizeDatePackage
ReservationBean.javaAPI DocExample3541Tue Jul 31 10:56:18 BST 2001com.titan.reservation

ReservationBean

public abstract class ReservationBean extends Object implements javax.ejb.EntityBean

Fields Summary
Constructors Summary
Methods Summary
public voidejbActivate()

public java.lang.ObjectejbCreate(CruiseLocal cruise, java.util.Collection customers)

		System.out.println("ReservationBean::ejbCreate");
        return null;
    
public java.lang.IntegerejbCreate(CustomerRemote customer, CruiseLocal cruise, CabinLocal cabin, double price, java.util.Date dateBooked)

		System.out.println("ReservationBean::ejbCreate");
        setAmountPaid(price);
		setDate(dateBooked);
		return null;
    
public voidejbLoad()

public voidejbPassivate()

public voidejbPostCreate(CruiseLocal cruise, java.util.Collection customers)

		System.out.println("ReservationBean::ejbPostCreate");
		setCruise(cruise);
 		Collection myCustomers = this.getCustomers();
		myCustomers.addAll(customers);
    
public voidejbPostCreate(CustomerRemote customer, CruiseLocal cruise, CabinLocal cabin, double price, java.util.Date dateBooked)

        
 		System.out.println("ReservationBean::ejbPostCreate");
        setCruise(cruise);
		// Our bean has many cabins, use the cmr set method here..
		Set cabins = new HashSet();
		cabins.add(cabin);
		this.setCabins(cabins);
        try {
            Integer primKey = (Integer)customer.getPrimaryKey();
            javax.naming.Context jndiContext = new InitialContext();
            CustomerHomeLocal home = (CustomerHomeLocal)
                jndiContext.lookup("java:comp/env/ejb/CustomerHomeLocal");  // get local interface
            CustomerLocal custL = home.findByPrimaryKey(primKey);
			// Our bean has many customers, use the cmr set method here..
			Set customers = new HashSet();
			customers.add(custL);
			this.setCustomers(customers);
        } catch (RemoteException re) {
            throw new CreateException("Invalid Customer - Bad Remote Reference");
        } catch (FinderException fe) {
            throw new CreateException("Invalid Customer - Unable to Find Local Reference");
        } catch (NamingException ne) {
            throw new CreateException("Invalid Customer - Unable to find CustomerHomeLocal Reference");
        }
    
public voidejbRemove()

public voidejbStore()

public abstract doublegetAmountPaid()

public abstract java.util.SetgetCabins()

public abstract CruiseLocalgetCruise()

public abstract java.util.SetgetCustomers()

public abstract java.util.DategetDate()

public abstract java.lang.IntegergetId()

public abstract voidsetAmountPaid(double amount)

public abstract voidsetCabins(java.util.Set cabins)

public abstract voidsetCruise(CruiseLocal cruise)

public abstract voidsetCustomers(java.util.Set customers)

public abstract voidsetDate(java.util.Date date)

public voidsetEntityContext(javax.ejb.EntityContext ec)

public abstract voidsetId(java.lang.Integer id)

public voidunsetEntityContext()