// PhoneBean.java

package hr;

import javax.ejb.*;
import java.rmi.*;
import java.util.*;

public abstract class PhoneBean implements EntityBean
{

    private EntityContext ectx;

    // getters and setters for cmp fields
    // ===========================================================

    public abstract String getPhoneNo();
    public abstract void setPhoneNo(String phoneNo);

    public abstract String getPhoneType();
    public abstract void setPhoneType(String phoneType);

    // ===========================================================

    public Object ejbCreate(Phone phone) throws CreateException
    {
        setPhoneNo(phone.getPhoneNo());
        setPhoneType(phone.getPhoneType());
        return null;
    }

    public void ejbPostCreate(Phone phone)
        throws CreateException
    {
        // when just after bean created
    }

    public void ejbStore()
    {
        // when bean persisted
    }

    public void ejbLoad()
    {
        // when bean loaded
    }

    public void ejbRemove()
    {
        // when bean removed
    }

    public void ejbActivate()
    {
        // when bean activated
    }

    public void ejbPassivate()
    {
        // when bean deactivated
    }

    public void setEntityContext(EntityContext ectx)
    {
        this.ectx = ectx;
    }

    public void unsetEntityContext()
    {
        this.ectx = null;
    }

}
