First page Back Continue Last page Graphics

...Continuation of Notes...


Notes:

EntityBeanBase Example
To illustrate the use of our EntityBeanBase class, here is our CustomerBean class from earlier, slightly revised:

public abstract class CustomerBean extends EntityBeanBase {

// For CMP field int id. Notice that only the get method
// is defined in the remote interface:
public abstract int getId(); // A business method.
public abstract void setId(int value); // Not a business method.

// For CMP field String lastName property:
public abstract String getLastName();
public abstract void setLastName(String value);

// For CMP field String firstName property:
public abstract String getFirstName();
public abstract void setFirstName(String value);


// This method is for the remote interface.
// Notice it uses the methods defined above:
public String getFullName() {
return getFirstName() + " " + getLastName();
}


// No methods from EntityBean interface; they’re all taken
// care of in the ancestor...
}

Continued...