FileDocCategorySizeDatePackage
CustomerBean.javaAPI DocExample5651Wed May 15 04:28:16 BST 2002com.titan.customer

CustomerBean

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

Fields Summary
Constructors Summary
Methods Summary
public voidaddPhoneNumber(java.lang.String number, byte type)

      InitialContext jndiEnc = new InitialContext();
      PhoneHomeLocal phoneHome = (PhoneHomeLocal)(jndiEnc.lookup("PhoneHomeLocal")); 

      PhoneLocal phone = phoneHome.create(number,type);
        
      Collection phoneNumbers = this.getPhoneNumbers( );
      phoneNumbers.add(phone);

   
public voidejbActivate()

public java.lang.IntegerejbCreate(java.lang.Integer id)

      this.setId(id);
      return null;
   
public java.util.CollectionejbHomeQueryCities()

      return ejbSelectCities();
   
public java.util.CollectionejbHomeQueryCreditCards()

      return ejbSelectCreditCards();
   
public java.util.CollectionejbHomeQueryCreditCompanyAddresses()

      return ejbSelectCreditCompanyAddresses();
   
public java.util.CollectionejbHomeQueryCreditCompanyCities()

      return ejbSelectCreditCompanyCities();
   
public java.util.CollectionejbHomeQueryCruises()

      return ejbSelectCruises();
   
public java.util.CollectionejbHomeQueryLastNames()

      return ejbSelectLastNames();
   
public java.util.CollectionejbHomeQueryReservations()

      return ejbSelectReservations();
   
public java.util.CollectionejbHomeQueryShips()

      return ejbSelectShips();
   
public voidejbLoad()

public voidejbPassivate()

public voidejbPostCreate(java.lang.Integer id)

   
public voidejbRemove()

public abstract java.util.CollectionejbSelectCities()

public abstract java.util.CollectionejbSelectCreditCards()

public abstract java.util.CollectionejbSelectCreditCompanyAddresses()

public abstract java.util.CollectionejbSelectCreditCompanyCities()

public abstract java.util.CollectionejbSelectCruises()

public abstract java.util.CollectionejbSelectLastNames()

public abstract java.util.CollectionejbSelectReservations()

public abstract java.util.CollectionejbSelectShips()

public voidejbStore()

public abstract CreditCardLocalgetCreditCard()

public abstract java.lang.StringgetFirstName()

public abstract booleangetHasGoodCredit()

public abstract AddressLocalgetHomeAddress()

public abstract java.lang.IntegergetId()

public abstract java.lang.StringgetLastName()

public NamegetName()

      Name name = new Name(getLastName(),getFirstName());
      return name;
   
public java.util.VectorgetPhoneList()

      Vector vv = new Vector();
      Collection phoneNumbers = this.getPhoneNumbers();
      Iterator iterator = phoneNumbers.iterator();
      while(iterator.hasNext()) {
         PhoneLocal phone = (PhoneLocal)iterator.next();
         String ss = "Type="+phone.getType()+"  Number="+phone.getNumber();
         vv.add(ss);
      }
      return vv;
   
public abstract java.util.CollectiongetPhoneNumbers()

public abstract java.util.CollectiongetReservations()

public voidremovePhoneNumber(byte typeToRemove)

      Collection phoneNumbers = this.getPhoneNumbers();
      Iterator iterator = phoneNumbers.iterator();

      while(iterator.hasNext())
      {
         PhoneLocal phone = (PhoneLocal)iterator.next();
         if (phone.getType() == typeToRemove) 
         {
            phoneNumbers.remove(phone);
            break;
         }

      }
   
public abstract voidsetCreditCard(CreditCardLocal card)

public voidsetEntityContext(javax.ejb.EntityContext ec)

public abstract voidsetFirstName(java.lang.String fname)

public abstract voidsetHasGoodCredit(boolean flag)

public abstract voidsetHomeAddress(AddressLocal address)

public abstract voidsetId(java.lang.Integer id)

public abstract voidsetLastName(java.lang.String lname)

public voidsetName(Name name)

      setLastName(name.getLastName());
      setFirstName(name.getFirstName());
   
public abstract voidsetPhoneNumbers(java.util.Collection phones)

public abstract voidsetReservations(java.util.Collection reservations)

public voidunsetEntityContext()

public voidupdatePhoneNumber(java.lang.String number, byte typeToUpdate)

 
      Collection phoneNumbers = this.getPhoneNumbers();
      Iterator iterator = phoneNumbers.iterator();
      while(iterator.hasNext())
      {
         PhoneLocal phone = (PhoneLocal)iterator.next();
         if (phone.getType() == typeToUpdate) 
         {
            phone.setNumber(number);
            break;
         }
      }