First page Back Continue Last page Graphics

Continuation of Notes...


Notes:

public abstract class CustomerBean implements EntityBean {

//================================================
// Instance Variables
//================================================
private String strFullName;

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

// More...

// Update the full name variable whenver data is loaded
// or stored:
public void ejbLoad() {
updateFullName();
}
public void ejbStore() {
updateFullName();
}

private void updateFullName() {
strFullName = getFirstName() + " " + getLastName();
}

// Rest of class...
} // End of CustomerBean class