FileDocCategorySizeDatePackage
CustomerBean.javaAPI DocExample3780Wed May 29 16:24:50 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 voidejbLoad()

public voidejbPassivate()

public voidejbPostCreate(java.lang.Integer id)

   
public voidejbRemove()

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.ArrayListgetPhoneList()

      ArrayList vv = new ArrayList();
      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;
         }
      }