FileDocCategorySizeDatePackage
CustomerBean.javaAPI DocExample3476Thu Nov 15 22:48:06 GMT 2001com.titan.customer

CustomerBean

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

Fields Summary
private javax.ejb.EntityContext
context
Constructors Summary
Methods Summary
public voidejbActivate()

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

		this.setId(id);
		return getId();
	
public voidejbLoad()

public voidejbPassivate()

public voidejbPostCreate(java.lang.Integer id)

	
public voidejbRemove()

public voidejbStore()

public AddressDOgetAddress()

		
        AddressLocal addrLocal = this.getHomeAddress();		// TODO THIS SHOULD WORK BUT RETURNS NULL
        Integer addressID = addrLocal.getId();
        String street = addrLocal.getStreet();
        String city = addrLocal.getCity();
        String state = addrLocal.getState();
        String zip = addrLocal.getZip();
        AddressDO addrValue = new AddressDO(addressID,street,city,state,zip);		
        return addrValue;
    
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 voidsetAddress(java.lang.Integer addressID, java.lang.String street, java.lang.String city, java.lang.String state, java.lang.String zip)

		AddressLocal addr = this.getHomeAddress();

        
        if (addr == null) {
			// Customer doesn't have an address yet. Create a new one.
			InitialContext cntx = new InitialContext();
			AddressHomeLocal addrHome = 
                       (AddressHomeLocal)cntx.lookup("java:comp/env/ejb/AddressHomeLocal");		
        	addr = addrHome.createAddress(addressID,street, city, state, zip);
			this.setHomeAddress(addr);
        } else {
           // Customer already has an address. Change its fields
           addr.setStreet(street);
           addr.setCity(city);
           addr.setState(state);
           addr.setZip(zip);
           //addr.setId(addressID);
        }
        
	
public voidsetAddress(AddressDO addrValue)

		

        String street = addrValue.getStreet();
        String city = addrValue.getCity();
        String state = addrValue.getState();
        String zip = addrValue.getZip();
        Integer addressID = addrValue.getId();

		setAddress(addressID, street,city,state,zip);		
	
public voidsetEntityContext(javax.ejb.EntityContext ec)

	    context = 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 voidunsetEntityContext()