The solution

You must create implementations for your skeletal setter methods created above. Each setter method is responsible for taking a value (either primitive or object) supplied by calling code and setting one or more fields in an underlying Dtls struct.

Our example requires these setters to be implemented:
Note: In general the JavaDoc for your setter implementations can simply inherit from your entity API JavaDoc.

Private setters must detail their own JavaDoc (as there is no API JavaDoc to inherit from).

setName

The setter for the name field maps the value provided to the name field on the Dtls struct. The setter must trim/compress white space and convert any null value passed to an empty string:

Figure 1. Implementation of a simple setter method
/**
   * {@inheritDoc}
   */
  public void setName(final String value) {
    getDtls().name = StringHelper.trim(value);
  }

The StringHelper class contains the convenience method trim which converts a null to an empty string, trims white space from the ends of genuine strings passed and compresses any contiguous embedded spaces down to a single space.

setDateRange

The setter for the date range field must set two values on the underlying Dtls struct:

Figure 2. Implementation of a setter method which sets multiple database column values from one object
/**
   * Sets the start and end fields from the date range supplied.
   *
   * @param value
   *          the date range supplied
   */
  private void setDateRange(final DateRange value) {
    getDtls().startDate = value.start();
    getDtls().endDate = value.end();
  }

setType

The setter for the typeCode database column must convert the state supplied into its codetable code for storage on the database:

Figure 3. Implementation of a setter which translates an codetable entry to a codetable code String value
/**
   * {@inheritDoc}
   */
  public void setType(final MYNEWENTITYTYPEEntry value) {
    getDtls().typeCode = value.getCode();
  }

setMyParentEntity

The setter for a related record must retrieve the object's ID and store it in the appropriate field on the Dtls struct. A null value must be converted to zero:

Figure 4. Implementation of a setter which sets a related entity
/**
   * {@inheritDoc}
   */
  public void setMyParentEntity(final MyParentEntity value) {
    final long myParentEntityID;
    if (value == null) {
      myParentEntityID = 0;
    } else {
      myParentEntityID = value.getID();
    }

    getDtls().myParentEntityID = myParentEntityID;
  }