Creating a Published Value Object

The business service foundation provides value object wizards that help you create value object classes that follow methodology rules for published value objects. The Value Object wizard creates objects based on database tables and business views for database operations or from the data structures defined within a business function.

When the wizard generates member variables for the published value object class, it uses the description that comes from the data dictionary item in the business function data structure or from table or business view columns as the variable name. If these are not the names that you want to use in your published interface, you can change them.

This code sample shows a generated variable:

   /**
    * Business Unit
    * An alphanumeric code that identifies a separate entity within a 
    * business for which you want to track costs. For example, a 
    * business unit might be a warehouse location, job, project, work 
    * center, branch, or plant.

    * EnterpriseOne Key Field: false
    * EnterpriseOne Alias: MCU
    * EnterpriseOne field length: 12
    */
    private String businessUnit = null;

You use the standard JDeveloper wizard to generate the getter and setter methods for the variables because the Value Object wizard does not generate these methods. For web services to be generated and deployed successfully, you must use J2EE standards for naming the getter and setter methods. J2EE standards for writing a field such as private String description would be:

public String getDescription(){
    return description;
 }
 public void setDescription(String description){
    this.description = description;
 }

For Boolean fields, the pattern is slightly different. J2EE standards for writing a field such as private Boolean isCreditExempt; would be:

public Boolean isIsCreditExempt(){
    return isCreditExempt;
 }
 public void setIsCreditExempt(Boolean isCreditExempt){
    this.isCreditExempt = isCreditExempt;
 }