FileDocCategorySizeDatePackage
CustomerBean.javaAPI DocExample4497Fri Jan 24 11:22:08 GMT 2003com.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.SetejbHomeDynamicQuery(java.lang.String jbossQL, java.lang.Object[] arguments)

      return ejbSelectGeneric(jbossQL, arguments);
   
public java.util.CollectionejbHomeQueryByCity(java.lang.String city, java.lang.String state)

      return ejbSelectByCity(city, state);
   
public voidejbLoad()

public voidejbPassivate()

public voidejbPostCreate(java.lang.Integer id)

   
public voidejbRemove()

public abstract java.util.CollectionejbSelectByCity(java.lang.String city, java.lang.String state)

public abstract java.util.SetejbSelectGeneric(java.lang.String jbossQl, java.lang.Object[] arguments)

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;
         }
      }