I am using value object in entity bean design. I am confused of whether or not to include the CMR field(s) in the value object at all. Keep in mind that these are local beans.


Here are my create and postCreate methods:

public java.lang.Long ejbCreate(
Long addressId, String addressName,
String street1, String street2,
String city, String postalCode,
CountryLocal country, StateLocal state)
    throws CreateException{
    setAddressId(addressId);
    setAddressName(addressName);
    setStreet1(street1);
    setStreet2(street2);
    setCity(city);
    setPostalCode(postalCode);
    return null;
}

public void ejbPostCreate(
Long addressId, String addressName,
String street1, String street2,
String city, String postalCode,
CountryLocal country, StateLocal state)
    throws CreateException{
    setCountry(country);
    setState(state);
}



Here is the value object. Should I include get/set country and state field in this file?

public class AddressValue implements java.io.Serializable {
    private Long _addressId;
    private String _addressName;
    private String _street1;
    private String _street2;
    private String _city;
    private String _postalCode;
    public AddressValue() {
    }
    /**
     * Set the value of addressId
    **/
    public void setAddressId(Long addressId){
        _addressId = addressId;
    }

    /**
     * Get the value of addressId
    **/
    public Long getAddressId(){
        return _addressId;
    }

    /**
     * Set the value of addressName
    **/
    public void setAddressName(String addressName){
        _addressName = addressName;
    }

    /**
     * Get the value of addressName
    **/
    public String getAddressName(){
        return _addressName;
    }

    /**
     * Set the value of street1
    **/
    public void setStreet1(String street1){
        _street1 = street1;
    }

    /**
     * Get the value of street1
    **/
    public String getStreet1(){
        return _street1;
    }

    /**
     * Set the value of street2
    **/
    public void setStreet2(String street2){
        _street2 = street2;
    }

    /**
     * Get the value of street2
    **/
    public String getStreet2(){
        return _street2;
    }

    /**
     * Set the value of city
    **/
    public void setCity(String city){
        _city = city;
    }

    /**
     * Get the value of city
    **/
    public String getCity(){
        return _city;
    }

    /**
     * Set the value of postalCode
    **/
    public void setPostalCode(String postalCode){
        _postalCode = postalCode;
    }

    /**
     * Get the value of postalCode
    **/
    public String getPostalCode(){
        return _postalCode;
    }
}