Hello,

When a field of type Timestamp is nullable, serialization fails(trace and
schema below) and the error disappears after changing the field to
mandatory. Please help understand the issue.

*Error:*

Caused by: org.apache.kafka.common.errors.SerializationException: Error
serializing Avro message
*Caused by: org.apache.avro.AvroRuntimeException: Unknown datum type
org.joda.time.DateTime: 2011-06-07T00:00:00.000Z*
at org.apache.avro.generic.GenericData.getSchemaName(GenericData.java:757)
at
org.apache.avro.specific.SpecificData.getSchemaName(SpecificData.java:314)
at org.apache.avro.generic.GenericData.resolveUnion(GenericData.java:721)
at
org.apache.avro.generic.GenericDatumWriter.resolveUnion(GenericDatumWriter.java:205)
at
org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:123)
at
org.apache.avro.specific.SpecificDatumWriter.writeField(SpecificDatumWriter.java:87)
at
org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:156)
at
org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:118)
at
org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:75)
at
org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:62)
at
io.confluent.kafka.serializers.AbstractKafkaAvroSerializer.serializeImpl(AbstractKafkaAvroSerializer.java:101)
at
io.confluent.kafka.serializers.KafkaAvroSerializer.serialize(KafkaAvroSerializer.java:53)
at
io.confluent.kafka.streams.serdes.avro.SpecificAvroSerializer.serialize(SpecificAvroSerializer.java:65)

*Schema of the problematic field:*

{
  "name": "shipdate",
  "type": [
    "null",
    {
      "type": "long",
      "connect.version": 1,
      "connect.name": "org.apache.kafka.connect.data.Timestamp",
      "logicalType": "timestamp-millis"
    }
  ],
  "default": null
}


*[ENVIRONMENT]*
Java 1.8
Apache maven 3.5.2maven 3.5.2
Avro 1.8.2 also tested with 1.9.0-SNAPSHOT
avro-maven-plugin
kafka-streams 2.0.0-cp1

Attachment: sat_salesorder_1.avsc
Description: Binary data

/**
 * Autogenerated by Avro
 *
 * DO NOT EDIT DIRECTLY
 */
package com;

import org.apache.avro.specific.SpecificData;
import org.apache.avro.message.BinaryMessageEncoder;
import org.apache.avro.message.BinaryMessageDecoder;
import org.apache.avro.message.SchemaStore;

@org.apache.avro.specific.AvroGenerated
public class sat_salesorder_1 extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  private static final long serialVersionUID = -2794175603870303774L;
  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"sat_salesorder_1\",\"namespace\":\"de.smava.data.vault20\",\"fields\":[{\"name\":\"hkey_salesorder\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"record_source\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"load_dtm\",\"type\":{\"type\":\"long\",\"connect.version\":1,\"connect.name\":\"org.apache.kafka.connect.data.Timestamp\",\"logicalType\":\"timestamp-millis\"}},{\"name\":\"load_end_dtm\",\"type\":{\"type\":\"long\",\"connect.version\":1,\"connect.name\":\"org.apache.kafka.connect.data.Timestamp\",\"logicalType\":\"timestamp-millis\"}},{\"name\":\"revisionnumber\",\"type\":{\"type\":\"int\",\"connect.type\":\"int16\"}},{\"name\":\"orderdate\",\"type\":{\"type\":\"long\",\"connect.version\":1,\"connect.name\":\"org.apache.kafka.connect.data.Timestamp\",\"logicalType\":\"timestamp-millis\"}},{\"name\":\"duedate\",\"type\":{\"type\":\"long\",\"connect.version\":1,\"connect.name\":\"org.apache.kafka.connect.data.Timestamp\",\"logicalType\":\"timestamp-millis\"}},{\"name\":\"shipdate\",\"type\":[\"null\",{\"type\":\"long\",\"connect.version\":1,\"connect.name\":\"org.apache.kafka.connect.data.Timestamp\",\"logicalType\":\"timestamp-millis\"}],\"default\":null},{\"name\":\"status\",\"type\":{\"type\":\"int\",\"connect.type\":\"int16\"}},{\"name\":\"onlineorderflag\",\"type\":\"boolean\"},{\"name\":\"purchaseordernumber\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"default\":null},{\"name\":\"accountnumber\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"default\":null},{\"name\":\"creditcardapprovalcode\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"default\":null},{\"name\":\"currencyrateid\",\"type\":[\"null\",\"int\"],\"default\":null},{\"name\":\"subtotal\",\"type\":\"double\"},{\"name\":\"taxamt\",\"type\":\"double\"},{\"name\":\"freight\",\"type\":\"double\"},{\"name\":\"totaldue\",\"type\":[\"null\",\"double\"],\"default\":null}],\"connect.name\":\"de.smava.data.vault20.sat_salesorder_1\"}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }

  private static SpecificData MODEL$ = new SpecificData();

  private static final BinaryMessageEncoder<sat_salesorder_1> ENCODER =
      new BinaryMessageEncoder<sat_salesorder_1>(MODEL$, SCHEMA$);

  private static final BinaryMessageDecoder<sat_salesorder_1> DECODER =
      new BinaryMessageDecoder<sat_salesorder_1>(MODEL$, SCHEMA$);

  /**
   * Return the BinaryMessageDecoder instance used by this class.
   * @return the message decoder used by this class
   */
  public static BinaryMessageDecoder<sat_salesorder_1> getDecoder() {
    return DECODER;
  }

  /**
   * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}.
   * @param resolver a {@link SchemaStore} used to find schemas by fingerprint
   * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore
   */
  public static BinaryMessageDecoder<sat_salesorder_1> createDecoder(SchemaStore resolver) {
    return new BinaryMessageDecoder<sat_salesorder_1>(MODEL$, SCHEMA$, resolver);
  }

  /**
   * Serializes this sat_salesorder_1 to a ByteBuffer.
   * @return a buffer holding the serialized data for this instance
   * @throws java.io.IOException if this instance could not be serialized
   */
  public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException {
    return ENCODER.encode(this);
  }

  /**
   * Deserializes a sat_salesorder_1 from a ByteBuffer.
   * @param b a byte buffer holding serialized data for an instance of this class
   * @return a sat_salesorder_1 instance decoded from the given buffer
   * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class
   */
  public static sat_salesorder_1 fromByteBuffer(
      java.nio.ByteBuffer b) throws java.io.IOException {
    return DECODER.decode(b);
  }

  @Deprecated public java.lang.String hkey_salesorder;
  @Deprecated public java.lang.String record_source;
  @Deprecated public org.joda.time.DateTime load_dtm;
  @Deprecated public org.joda.time.DateTime load_end_dtm;
  @Deprecated public int revisionnumber;
  @Deprecated public org.joda.time.DateTime orderdate;
  @Deprecated public org.joda.time.DateTime duedate;
  @Deprecated public org.joda.time.DateTime shipdate;
  @Deprecated public int status;
  @Deprecated public boolean onlineorderflag;
  @Deprecated public java.lang.String purchaseordernumber;
  @Deprecated public java.lang.String accountnumber;
  @Deprecated public java.lang.String creditcardapprovalcode;
  @Deprecated public java.lang.Integer currencyrateid;
  @Deprecated public double subtotal;
  @Deprecated public double taxamt;
  @Deprecated public double freight;
  @Deprecated public java.lang.Double totaldue;

  /**
   * Default constructor.  Note that this does not initialize fields
   * to their default values from the schema.  If that is desired then
   * one should use <code>newBuilder()</code>.
   */
  public sat_salesorder_1() {}

  /**
   * All-args constructor.
   * @param hkey_salesorder The new value for hkey_salesorder
   * @param record_source The new value for record_source
   * @param load_dtm The new value for load_dtm
   * @param load_end_dtm The new value for load_end_dtm
   * @param revisionnumber The new value for revisionnumber
   * @param orderdate The new value for orderdate
   * @param duedate The new value for duedate
   * @param shipdate The new value for shipdate
   * @param status The new value for status
   * @param onlineorderflag The new value for onlineorderflag
   * @param purchaseordernumber The new value for purchaseordernumber
   * @param accountnumber The new value for accountnumber
   * @param creditcardapprovalcode The new value for creditcardapprovalcode
   * @param currencyrateid The new value for currencyrateid
   * @param subtotal The new value for subtotal
   * @param taxamt The new value for taxamt
   * @param freight The new value for freight
   * @param totaldue The new value for totaldue
   */
  public sat_salesorder_1(java.lang.String hkey_salesorder, java.lang.String record_source, org.joda.time.DateTime load_dtm, org.joda.time.DateTime load_end_dtm, java.lang.Integer revisionnumber, org.joda.time.DateTime orderdate, org.joda.time.DateTime duedate, org.joda.time.DateTime shipdate, java.lang.Integer status, java.lang.Boolean onlineorderflag, java.lang.String purchaseordernumber, java.lang.String accountnumber, java.lang.String creditcardapprovalcode, java.lang.Integer currencyrateid, java.lang.Double subtotal, java.lang.Double taxamt, java.lang.Double freight, java.lang.Double totaldue) {
    this.hkey_salesorder = hkey_salesorder;
    this.record_source = record_source;
    this.load_dtm = load_dtm;
    this.load_end_dtm = load_end_dtm;
    this.revisionnumber = revisionnumber;
    this.orderdate = orderdate;
    this.duedate = duedate;
    this.shipdate = shipdate;
    this.status = status;
    this.onlineorderflag = onlineorderflag;
    this.purchaseordernumber = purchaseordernumber;
    this.accountnumber = accountnumber;
    this.creditcardapprovalcode = creditcardapprovalcode;
    this.currencyrateid = currencyrateid;
    this.subtotal = subtotal;
    this.taxamt = taxamt;
    this.freight = freight;
    this.totaldue = totaldue;
  }

  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
  // Used by DatumWriter.  Applications should not call.
  public java.lang.Object get(int field$) {
    switch (field$) {
    case 0: return hkey_salesorder;
    case 1: return record_source;
    case 2: return load_dtm;
    case 3: return load_end_dtm;
    case 4: return revisionnumber;
    case 5: return orderdate;
    case 6: return duedate;
    case 7: return shipdate;
    case 8: return status;
    case 9: return onlineorderflag;
    case 10: return purchaseordernumber;
    case 11: return accountnumber;
    case 12: return creditcardapprovalcode;
    case 13: return currencyrateid;
    case 14: return subtotal;
    case 15: return taxamt;
    case 16: return freight;
    case 17: return totaldue;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  protected static final org.apache.avro.data.TimeConversions.DateConversion DATE_CONVERSION = new org.apache.avro.data.TimeConversions.DateConversion();
  protected static final org.apache.avro.data.TimeConversions.TimeConversion TIME_CONVERSION = new org.apache.avro.data.TimeConversions.TimeConversion();
  protected static final org.apache.avro.data.TimeConversions.TimestampConversion TIMESTAMP_CONVERSION = new org.apache.avro.data.TimeConversions.TimestampConversion();
  protected static final org.apache.avro.Conversions.DecimalConversion DECIMAL_CONVERSION = new org.apache.avro.Conversions.DecimalConversion();

  private static final org.apache.avro.Conversion<?>[] conversions =
      new org.apache.avro.Conversion<?>[] {
      null,
      null,
      TIMESTAMP_CONVERSION,
      TIMESTAMP_CONVERSION,
      null,
      TIMESTAMP_CONVERSION,
      TIMESTAMP_CONVERSION,
      null,
      null,
      null,
      null,
      null,
      null,
      null,
      null,
      null,
      null,
      null,
      null
  };

  @Override
  public org.apache.avro.Conversion<?> getConversion(int field) {
    return conversions[field];
  }

  // Used by DatumReader.  Applications should not call.
  @SuppressWarnings(value="unchecked")
  public void put(int field$, java.lang.Object value$) {
    switch (field$) {
    case 0: hkey_salesorder = (java.lang.String)value$; break;
    case 1: record_source = (java.lang.String)value$; break;
    case 2: load_dtm = (org.joda.time.DateTime)value$; break;
    case 3: load_end_dtm = (org.joda.time.DateTime)value$; break;
    case 4: revisionnumber = (java.lang.Integer)value$; break;
    case 5: orderdate = (org.joda.time.DateTime)value$; break;
    case 6: duedate = (org.joda.time.DateTime)value$; break;
    case 7: shipdate = (org.joda.time.DateTime)value$; break;
    case 8: status = (java.lang.Integer)value$; break;
    case 9: onlineorderflag = (java.lang.Boolean)value$; break;
    case 10: purchaseordernumber = (java.lang.String)value$; break;
    case 11: accountnumber = (java.lang.String)value$; break;
    case 12: creditcardapprovalcode = (java.lang.String)value$; break;
    case 13: currencyrateid = (java.lang.Integer)value$; break;
    case 14: subtotal = (java.lang.Double)value$; break;
    case 15: taxamt = (java.lang.Double)value$; break;
    case 16: freight = (java.lang.Double)value$; break;
    case 17: totaldue = (java.lang.Double)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'hkey_salesorder' field.
   * @return The value of the 'hkey_salesorder' field.
   */
  public java.lang.String getHkeySalesorder() {
    return hkey_salesorder;
  }

  /**
   * Sets the value of the 'hkey_salesorder' field.
   * @param value the value to set.
   */
  public void setHkeySalesorder(java.lang.String value) {
    this.hkey_salesorder = value;
  }

  /**
   * Gets the value of the 'record_source' field.
   * @return The value of the 'record_source' field.
   */
  public java.lang.String getRecordSource() {
    return record_source;
  }

  /**
   * Sets the value of the 'record_source' field.
   * @param value the value to set.
   */
  public void setRecordSource(java.lang.String value) {
    this.record_source = value;
  }

  /**
   * Gets the value of the 'load_dtm' field.
   * @return The value of the 'load_dtm' field.
   */
  public org.joda.time.DateTime getLoadDtm() {
    return load_dtm;
  }

  /**
   * Sets the value of the 'load_dtm' field.
   * @param value the value to set.
   */
  public void setLoadDtm(org.joda.time.DateTime value) {
    this.load_dtm = value;
  }

  /**
   * Gets the value of the 'load_end_dtm' field.
   * @return The value of the 'load_end_dtm' field.
   */
  public org.joda.time.DateTime getLoadEndDtm() {
    return load_end_dtm;
  }

  /**
   * Sets the value of the 'load_end_dtm' field.
   * @param value the value to set.
   */
  public void setLoadEndDtm(org.joda.time.DateTime value) {
    this.load_end_dtm = value;
  }

  /**
   * Gets the value of the 'revisionnumber' field.
   * @return The value of the 'revisionnumber' field.
   */
  public java.lang.Integer getRevisionnumber() {
    return revisionnumber;
  }

  /**
   * Sets the value of the 'revisionnumber' field.
   * @param value the value to set.
   */
  public void setRevisionnumber(java.lang.Integer value) {
    this.revisionnumber = value;
  }

  /**
   * Gets the value of the 'orderdate' field.
   * @return The value of the 'orderdate' field.
   */
  public org.joda.time.DateTime getOrderdate() {
    return orderdate;
  }

  /**
   * Sets the value of the 'orderdate' field.
   * @param value the value to set.
   */
  public void setOrderdate(org.joda.time.DateTime value) {
    this.orderdate = value;
  }

  /**
   * Gets the value of the 'duedate' field.
   * @return The value of the 'duedate' field.
   */
  public org.joda.time.DateTime getDuedate() {
    return duedate;
  }

  /**
   * Sets the value of the 'duedate' field.
   * @param value the value to set.
   */
  public void setDuedate(org.joda.time.DateTime value) {
    this.duedate = value;
  }

  /**
   * Gets the value of the 'shipdate' field.
   * @return The value of the 'shipdate' field.
   */
  public org.joda.time.DateTime getShipdate() {
    return shipdate;
  }

  /**
   * Sets the value of the 'shipdate' field.
   * @param value the value to set.
   */
  public void setShipdate(org.joda.time.DateTime value) {
    this.shipdate = value;
  }

  /**
   * Gets the value of the 'status' field.
   * @return The value of the 'status' field.
   */
  public java.lang.Integer getStatus() {
    return status;
  }

  /**
   * Sets the value of the 'status' field.
   * @param value the value to set.
   */
  public void setStatus(java.lang.Integer value) {
    this.status = value;
  }

  /**
   * Gets the value of the 'onlineorderflag' field.
   * @return The value of the 'onlineorderflag' field.
   */
  public java.lang.Boolean getOnlineorderflag() {
    return onlineorderflag;
  }

  /**
   * Sets the value of the 'onlineorderflag' field.
   * @param value the value to set.
   */
  public void setOnlineorderflag(java.lang.Boolean value) {
    this.onlineorderflag = value;
  }

  /**
   * Gets the value of the 'purchaseordernumber' field.
   * @return The value of the 'purchaseordernumber' field.
   */
  public java.lang.String getPurchaseordernumber() {
    return purchaseordernumber;
  }

  /**
   * Sets the value of the 'purchaseordernumber' field.
   * @param value the value to set.
   */
  public void setPurchaseordernumber(java.lang.String value) {
    this.purchaseordernumber = value;
  }

  /**
   * Gets the value of the 'accountnumber' field.
   * @return The value of the 'accountnumber' field.
   */
  public java.lang.String getAccountnumber() {
    return accountnumber;
  }

  /**
   * Sets the value of the 'accountnumber' field.
   * @param value the value to set.
   */
  public void setAccountnumber(java.lang.String value) {
    this.accountnumber = value;
  }

  /**
   * Gets the value of the 'creditcardapprovalcode' field.
   * @return The value of the 'creditcardapprovalcode' field.
   */
  public java.lang.String getCreditcardapprovalcode() {
    return creditcardapprovalcode;
  }

  /**
   * Sets the value of the 'creditcardapprovalcode' field.
   * @param value the value to set.
   */
  public void setCreditcardapprovalcode(java.lang.String value) {
    this.creditcardapprovalcode = value;
  }

  /**
   * Gets the value of the 'currencyrateid' field.
   * @return The value of the 'currencyrateid' field.
   */
  public java.lang.Integer getCurrencyrateid() {
    return currencyrateid;
  }

  /**
   * Sets the value of the 'currencyrateid' field.
   * @param value the value to set.
   */
  public void setCurrencyrateid(java.lang.Integer value) {
    this.currencyrateid = value;
  }

  /**
   * Gets the value of the 'subtotal' field.
   * @return The value of the 'subtotal' field.
   */
  public java.lang.Double getSubtotal() {
    return subtotal;
  }

  /**
   * Sets the value of the 'subtotal' field.
   * @param value the value to set.
   */
  public void setSubtotal(java.lang.Double value) {
    this.subtotal = value;
  }

  /**
   * Gets the value of the 'taxamt' field.
   * @return The value of the 'taxamt' field.
   */
  public java.lang.Double getTaxamt() {
    return taxamt;
  }

  /**
   * Sets the value of the 'taxamt' field.
   * @param value the value to set.
   */
  public void setTaxamt(java.lang.Double value) {
    this.taxamt = value;
  }

  /**
   * Gets the value of the 'freight' field.
   * @return The value of the 'freight' field.
   */
  public java.lang.Double getFreight() {
    return freight;
  }

  /**
   * Sets the value of the 'freight' field.
   * @param value the value to set.
   */
  public void setFreight(java.lang.Double value) {
    this.freight = value;
  }

  /**
   * Gets the value of the 'totaldue' field.
   * @return The value of the 'totaldue' field.
   */
  public java.lang.Double getTotaldue() {
    return totaldue;
  }

  /**
   * Sets the value of the 'totaldue' field.
   * @param value the value to set.
   */
  public void setTotaldue(java.lang.Double value) {
    this.totaldue = value;
  }

  /**
   * Creates a new sat_salesorder_1 RecordBuilder.
   * @return A new sat_salesorder_1 RecordBuilder
   */
  public static de.smava.data.vault20.sat_salesorder_1.Builder newBuilder() {
    return new de.smava.data.vault20.sat_salesorder_1.Builder();
  }

  /**
   * Creates a new sat_salesorder_1 RecordBuilder by copying an existing Builder.
   * @param other The existing builder to copy.
   * @return A new sat_salesorder_1 RecordBuilder
   */
  public static de.smava.data.vault20.sat_salesorder_1.Builder newBuilder(de.smava.data.vault20.sat_salesorder_1.Builder other) {
    if (other == null) {
      return new de.smava.data.vault20.sat_salesorder_1.Builder();
    } else {
      return new de.smava.data.vault20.sat_salesorder_1.Builder(other);
    }
  }

  /**
   * Creates a new sat_salesorder_1 RecordBuilder by copying an existing sat_salesorder_1 instance.
   * @param other The existing instance to copy.
   * @return A new sat_salesorder_1 RecordBuilder
   */
  public static de.smava.data.vault20.sat_salesorder_1.Builder newBuilder(de.smava.data.vault20.sat_salesorder_1 other) {
    if (other == null) {
      return new de.smava.data.vault20.sat_salesorder_1.Builder();
    } else {
      return new de.smava.data.vault20.sat_salesorder_1.Builder(other);
    }
  }

  /**
   * RecordBuilder for sat_salesorder_1 instances.
   */
  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<sat_salesorder_1>
    implements org.apache.avro.data.RecordBuilder<sat_salesorder_1> {

    private java.lang.String hkey_salesorder;
    private java.lang.String record_source;
    private org.joda.time.DateTime load_dtm;
    private org.joda.time.DateTime load_end_dtm;
    private int revisionnumber;
    private org.joda.time.DateTime orderdate;
    private org.joda.time.DateTime duedate;
    private org.joda.time.DateTime shipdate;
    private int status;
    private boolean onlineorderflag;
    private java.lang.String purchaseordernumber;
    private java.lang.String accountnumber;
    private java.lang.String creditcardapprovalcode;
    private java.lang.Integer currencyrateid;
    private double subtotal;
    private double taxamt;
    private double freight;
    private java.lang.Double totaldue;

    /** Creates a new Builder */
    private Builder() {
      super(SCHEMA$);
    }

    /**
     * Creates a Builder by copying an existing Builder.
     * @param other The existing Builder to copy.
     */
    private Builder(de.smava.data.vault20.sat_salesorder_1.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.hkey_salesorder)) {
        this.hkey_salesorder = data().deepCopy(fields()[0].schema(), other.hkey_salesorder);
        fieldSetFlags()[0] = other.fieldSetFlags()[0];
      }
      if (isValidValue(fields()[1], other.record_source)) {
        this.record_source = data().deepCopy(fields()[1].schema(), other.record_source);
        fieldSetFlags()[1] = other.fieldSetFlags()[1];
      }
      if (isValidValue(fields()[2], other.load_dtm)) {
        this.load_dtm = data().deepCopy(fields()[2].schema(), other.load_dtm);
        fieldSetFlags()[2] = other.fieldSetFlags()[2];
      }
      if (isValidValue(fields()[3], other.load_end_dtm)) {
        this.load_end_dtm = data().deepCopy(fields()[3].schema(), other.load_end_dtm);
        fieldSetFlags()[3] = other.fieldSetFlags()[3];
      }
      if (isValidValue(fields()[4], other.revisionnumber)) {
        this.revisionnumber = data().deepCopy(fields()[4].schema(), other.revisionnumber);
        fieldSetFlags()[4] = other.fieldSetFlags()[4];
      }
      if (isValidValue(fields()[5], other.orderdate)) {
        this.orderdate = data().deepCopy(fields()[5].schema(), other.orderdate);
        fieldSetFlags()[5] = other.fieldSetFlags()[5];
      }
      if (isValidValue(fields()[6], other.duedate)) {
        this.duedate = data().deepCopy(fields()[6].schema(), other.duedate);
        fieldSetFlags()[6] = other.fieldSetFlags()[6];
      }
      if (isValidValue(fields()[7], other.shipdate)) {
        this.shipdate = data().deepCopy(fields()[7].schema(), other.shipdate);
        fieldSetFlags()[7] = other.fieldSetFlags()[7];
      }
      if (isValidValue(fields()[8], other.status)) {
        this.status = data().deepCopy(fields()[8].schema(), other.status);
        fieldSetFlags()[8] = other.fieldSetFlags()[8];
      }
      if (isValidValue(fields()[9], other.onlineorderflag)) {
        this.onlineorderflag = data().deepCopy(fields()[9].schema(), other.onlineorderflag);
        fieldSetFlags()[9] = other.fieldSetFlags()[9];
      }
      if (isValidValue(fields()[10], other.purchaseordernumber)) {
        this.purchaseordernumber = data().deepCopy(fields()[10].schema(), other.purchaseordernumber);
        fieldSetFlags()[10] = other.fieldSetFlags()[10];
      }
      if (isValidValue(fields()[11], other.accountnumber)) {
        this.accountnumber = data().deepCopy(fields()[11].schema(), other.accountnumber);
        fieldSetFlags()[11] = other.fieldSetFlags()[11];
      }
      if (isValidValue(fields()[12], other.creditcardapprovalcode)) {
        this.creditcardapprovalcode = data().deepCopy(fields()[12].schema(), other.creditcardapprovalcode);
        fieldSetFlags()[12] = other.fieldSetFlags()[12];
      }
      if (isValidValue(fields()[13], other.currencyrateid)) {
        this.currencyrateid = data().deepCopy(fields()[13].schema(), other.currencyrateid);
        fieldSetFlags()[13] = other.fieldSetFlags()[13];
      }
      if (isValidValue(fields()[14], other.subtotal)) {
        this.subtotal = data().deepCopy(fields()[14].schema(), other.subtotal);
        fieldSetFlags()[14] = other.fieldSetFlags()[14];
      }
      if (isValidValue(fields()[15], other.taxamt)) {
        this.taxamt = data().deepCopy(fields()[15].schema(), other.taxamt);
        fieldSetFlags()[15] = other.fieldSetFlags()[15];
      }
      if (isValidValue(fields()[16], other.freight)) {
        this.freight = data().deepCopy(fields()[16].schema(), other.freight);
        fieldSetFlags()[16] = other.fieldSetFlags()[16];
      }
      if (isValidValue(fields()[17], other.totaldue)) {
        this.totaldue = data().deepCopy(fields()[17].schema(), other.totaldue);
        fieldSetFlags()[17] = other.fieldSetFlags()[17];
      }
    }

    /**
     * Creates a Builder by copying an existing sat_salesorder_1 instance
     * @param other The existing instance to copy.
     */
    private Builder(de.smava.data.vault20.sat_salesorder_1 other) {
      super(SCHEMA$);
      if (isValidValue(fields()[0], other.hkey_salesorder)) {
        this.hkey_salesorder = data().deepCopy(fields()[0].schema(), other.hkey_salesorder);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.record_source)) {
        this.record_source = data().deepCopy(fields()[1].schema(), other.record_source);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.load_dtm)) {
        this.load_dtm = data().deepCopy(fields()[2].schema(), other.load_dtm);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.load_end_dtm)) {
        this.load_end_dtm = data().deepCopy(fields()[3].schema(), other.load_end_dtm);
        fieldSetFlags()[3] = true;
      }
      if (isValidValue(fields()[4], other.revisionnumber)) {
        this.revisionnumber = data().deepCopy(fields()[4].schema(), other.revisionnumber);
        fieldSetFlags()[4] = true;
      }
      if (isValidValue(fields()[5], other.orderdate)) {
        this.orderdate = data().deepCopy(fields()[5].schema(), other.orderdate);
        fieldSetFlags()[5] = true;
      }
      if (isValidValue(fields()[6], other.duedate)) {
        this.duedate = data().deepCopy(fields()[6].schema(), other.duedate);
        fieldSetFlags()[6] = true;
      }
      if (isValidValue(fields()[7], other.shipdate)) {
        this.shipdate = data().deepCopy(fields()[7].schema(), other.shipdate);
        fieldSetFlags()[7] = true;
      }
      if (isValidValue(fields()[8], other.status)) {
        this.status = data().deepCopy(fields()[8].schema(), other.status);
        fieldSetFlags()[8] = true;
      }
      if (isValidValue(fields()[9], other.onlineorderflag)) {
        this.onlineorderflag = data().deepCopy(fields()[9].schema(), other.onlineorderflag);
        fieldSetFlags()[9] = true;
      }
      if (isValidValue(fields()[10], other.purchaseordernumber)) {
        this.purchaseordernumber = data().deepCopy(fields()[10].schema(), other.purchaseordernumber);
        fieldSetFlags()[10] = true;
      }
      if (isValidValue(fields()[11], other.accountnumber)) {
        this.accountnumber = data().deepCopy(fields()[11].schema(), other.accountnumber);
        fieldSetFlags()[11] = true;
      }
      if (isValidValue(fields()[12], other.creditcardapprovalcode)) {
        this.creditcardapprovalcode = data().deepCopy(fields()[12].schema(), other.creditcardapprovalcode);
        fieldSetFlags()[12] = true;
      }
      if (isValidValue(fields()[13], other.currencyrateid)) {
        this.currencyrateid = data().deepCopy(fields()[13].schema(), other.currencyrateid);
        fieldSetFlags()[13] = true;
      }
      if (isValidValue(fields()[14], other.subtotal)) {
        this.subtotal = data().deepCopy(fields()[14].schema(), other.subtotal);
        fieldSetFlags()[14] = true;
      }
      if (isValidValue(fields()[15], other.taxamt)) {
        this.taxamt = data().deepCopy(fields()[15].schema(), other.taxamt);
        fieldSetFlags()[15] = true;
      }
      if (isValidValue(fields()[16], other.freight)) {
        this.freight = data().deepCopy(fields()[16].schema(), other.freight);
        fieldSetFlags()[16] = true;
      }
      if (isValidValue(fields()[17], other.totaldue)) {
        this.totaldue = data().deepCopy(fields()[17].schema(), other.totaldue);
        fieldSetFlags()[17] = true;
      }
    }

    /**
      * Gets the value of the 'hkey_salesorder' field.
      * @return The value.
      */
    public java.lang.String getHkeySalesorder() {
      return hkey_salesorder;
    }

    /**
      * Sets the value of the 'hkey_salesorder' field.
      * @param value The value of 'hkey_salesorder'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setHkeySalesorder(java.lang.String value) {
      validate(fields()[0], value);
      this.hkey_salesorder = value;
      fieldSetFlags()[0] = true;
      return this;
    }

    /**
      * Checks whether the 'hkey_salesorder' field has been set.
      * @return True if the 'hkey_salesorder' field has been set, false otherwise.
      */
    public boolean hasHkeySalesorder() {
      return fieldSetFlags()[0];
    }


    /**
      * Clears the value of the 'hkey_salesorder' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearHkeySalesorder() {
      hkey_salesorder = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /**
      * Gets the value of the 'record_source' field.
      * @return The value.
      */
    public java.lang.String getRecordSource() {
      return record_source;
    }

    /**
      * Sets the value of the 'record_source' field.
      * @param value The value of 'record_source'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setRecordSource(java.lang.String value) {
      validate(fields()[1], value);
      this.record_source = value;
      fieldSetFlags()[1] = true;
      return this;
    }

    /**
      * Checks whether the 'record_source' field has been set.
      * @return True if the 'record_source' field has been set, false otherwise.
      */
    public boolean hasRecordSource() {
      return fieldSetFlags()[1];
    }


    /**
      * Clears the value of the 'record_source' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearRecordSource() {
      record_source = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    /**
      * Gets the value of the 'load_dtm' field.
      * @return The value.
      */
    public org.joda.time.DateTime getLoadDtm() {
      return load_dtm;
    }

    /**
      * Sets the value of the 'load_dtm' field.
      * @param value The value of 'load_dtm'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setLoadDtm(org.joda.time.DateTime value) {
      validate(fields()[2], value);
      this.load_dtm = value;
      fieldSetFlags()[2] = true;
      return this;
    }

    /**
      * Checks whether the 'load_dtm' field has been set.
      * @return True if the 'load_dtm' field has been set, false otherwise.
      */
    public boolean hasLoadDtm() {
      return fieldSetFlags()[2];
    }


    /**
      * Clears the value of the 'load_dtm' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearLoadDtm() {
      fieldSetFlags()[2] = false;
      return this;
    }

    /**
      * Gets the value of the 'load_end_dtm' field.
      * @return The value.
      */
    public org.joda.time.DateTime getLoadEndDtm() {
      return load_end_dtm;
    }

    /**
      * Sets the value of the 'load_end_dtm' field.
      * @param value The value of 'load_end_dtm'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setLoadEndDtm(org.joda.time.DateTime value) {
      validate(fields()[3], value);
      this.load_end_dtm = value;
      fieldSetFlags()[3] = true;
      return this;
    }

    /**
      * Checks whether the 'load_end_dtm' field has been set.
      * @return True if the 'load_end_dtm' field has been set, false otherwise.
      */
    public boolean hasLoadEndDtm() {
      return fieldSetFlags()[3];
    }


    /**
      * Clears the value of the 'load_end_dtm' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearLoadEndDtm() {
      fieldSetFlags()[3] = false;
      return this;
    }

    /**
      * Gets the value of the 'revisionnumber' field.
      * @return The value.
      */
    public java.lang.Integer getRevisionnumber() {
      return revisionnumber;
    }

    /**
      * Sets the value of the 'revisionnumber' field.
      * @param value The value of 'revisionnumber'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setRevisionnumber(int value) {
      validate(fields()[4], value);
      this.revisionnumber = value;
      fieldSetFlags()[4] = true;
      return this;
    }

    /**
      * Checks whether the 'revisionnumber' field has been set.
      * @return True if the 'revisionnumber' field has been set, false otherwise.
      */
    public boolean hasRevisionnumber() {
      return fieldSetFlags()[4];
    }


    /**
      * Clears the value of the 'revisionnumber' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearRevisionnumber() {
      fieldSetFlags()[4] = false;
      return this;
    }

    /**
      * Gets the value of the 'orderdate' field.
      * @return The value.
      */
    public org.joda.time.DateTime getOrderdate() {
      return orderdate;
    }

    /**
      * Sets the value of the 'orderdate' field.
      * @param value The value of 'orderdate'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setOrderdate(org.joda.time.DateTime value) {
      validate(fields()[5], value);
      this.orderdate = value;
      fieldSetFlags()[5] = true;
      return this;
    }

    /**
      * Checks whether the 'orderdate' field has been set.
      * @return True if the 'orderdate' field has been set, false otherwise.
      */
    public boolean hasOrderdate() {
      return fieldSetFlags()[5];
    }


    /**
      * Clears the value of the 'orderdate' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearOrderdate() {
      fieldSetFlags()[5] = false;
      return this;
    }

    /**
      * Gets the value of the 'duedate' field.
      * @return The value.
      */
    public org.joda.time.DateTime getDuedate() {
      return duedate;
    }

    /**
      * Sets the value of the 'duedate' field.
      * @param value The value of 'duedate'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setDuedate(org.joda.time.DateTime value) {
      validate(fields()[6], value);
      this.duedate = value;
      fieldSetFlags()[6] = true;
      return this;
    }

    /**
      * Checks whether the 'duedate' field has been set.
      * @return True if the 'duedate' field has been set, false otherwise.
      */
    public boolean hasDuedate() {
      return fieldSetFlags()[6];
    }


    /**
      * Clears the value of the 'duedate' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearDuedate() {
      fieldSetFlags()[6] = false;
      return this;
    }

    /**
      * Gets the value of the 'shipdate' field.
      * @return The value.
      */
    public org.joda.time.DateTime getShipdate() {
      return shipdate;
    }

    /**
      * Sets the value of the 'shipdate' field.
      * @param value The value of 'shipdate'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setShipdate(org.joda.time.DateTime value) {
      validate(fields()[7], value);
      this.shipdate = value;
      fieldSetFlags()[7] = true;
      return this;
    }

    /**
      * Checks whether the 'shipdate' field has been set.
      * @return True if the 'shipdate' field has been set, false otherwise.
      */
    public boolean hasShipdate() {
      return fieldSetFlags()[7];
    }


    /**
      * Clears the value of the 'shipdate' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearShipdate() {
      shipdate = null;
      fieldSetFlags()[7] = false;
      return this;
    }

    /**
      * Gets the value of the 'status' field.
      * @return The value.
      */
    public java.lang.Integer getStatus() {
      return status;
    }

    /**
      * Sets the value of the 'status' field.
      * @param value The value of 'status'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setStatus(int value) {
      validate(fields()[8], value);
      this.status = value;
      fieldSetFlags()[8] = true;
      return this;
    }

    /**
      * Checks whether the 'status' field has been set.
      * @return True if the 'status' field has been set, false otherwise.
      */
    public boolean hasStatus() {
      return fieldSetFlags()[8];
    }


    /**
      * Clears the value of the 'status' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearStatus() {
      fieldSetFlags()[8] = false;
      return this;
    }

    /**
      * Gets the value of the 'onlineorderflag' field.
      * @return The value.
      */
    public java.lang.Boolean getOnlineorderflag() {
      return onlineorderflag;
    }

    /**
      * Sets the value of the 'onlineorderflag' field.
      * @param value The value of 'onlineorderflag'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setOnlineorderflag(boolean value) {
      validate(fields()[9], value);
      this.onlineorderflag = value;
      fieldSetFlags()[9] = true;
      return this;
    }

    /**
      * Checks whether the 'onlineorderflag' field has been set.
      * @return True if the 'onlineorderflag' field has been set, false otherwise.
      */
    public boolean hasOnlineorderflag() {
      return fieldSetFlags()[9];
    }


    /**
      * Clears the value of the 'onlineorderflag' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearOnlineorderflag() {
      fieldSetFlags()[9] = false;
      return this;
    }

    /**
      * Gets the value of the 'purchaseordernumber' field.
      * @return The value.
      */
    public java.lang.String getPurchaseordernumber() {
      return purchaseordernumber;
    }

    /**
      * Sets the value of the 'purchaseordernumber' field.
      * @param value The value of 'purchaseordernumber'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setPurchaseordernumber(java.lang.String value) {
      validate(fields()[10], value);
      this.purchaseordernumber = value;
      fieldSetFlags()[10] = true;
      return this;
    }

    /**
      * Checks whether the 'purchaseordernumber' field has been set.
      * @return True if the 'purchaseordernumber' field has been set, false otherwise.
      */
    public boolean hasPurchaseordernumber() {
      return fieldSetFlags()[10];
    }


    /**
      * Clears the value of the 'purchaseordernumber' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearPurchaseordernumber() {
      purchaseordernumber = null;
      fieldSetFlags()[10] = false;
      return this;
    }

    /**
      * Gets the value of the 'accountnumber' field.
      * @return The value.
      */
    public java.lang.String getAccountnumber() {
      return accountnumber;
    }

    /**
      * Sets the value of the 'accountnumber' field.
      * @param value The value of 'accountnumber'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setAccountnumber(java.lang.String value) {
      validate(fields()[11], value);
      this.accountnumber = value;
      fieldSetFlags()[11] = true;
      return this;
    }

    /**
      * Checks whether the 'accountnumber' field has been set.
      * @return True if the 'accountnumber' field has been set, false otherwise.
      */
    public boolean hasAccountnumber() {
      return fieldSetFlags()[11];
    }


    /**
      * Clears the value of the 'accountnumber' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearAccountnumber() {
      accountnumber = null;
      fieldSetFlags()[11] = false;
      return this;
    }

    /**
      * Gets the value of the 'creditcardapprovalcode' field.
      * @return The value.
      */
    public java.lang.String getCreditcardapprovalcode() {
      return creditcardapprovalcode;
    }

    /**
      * Sets the value of the 'creditcardapprovalcode' field.
      * @param value The value of 'creditcardapprovalcode'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setCreditcardapprovalcode(java.lang.String value) {
      validate(fields()[12], value);
      this.creditcardapprovalcode = value;
      fieldSetFlags()[12] = true;
      return this;
    }

    /**
      * Checks whether the 'creditcardapprovalcode' field has been set.
      * @return True if the 'creditcardapprovalcode' field has been set, false otherwise.
      */
    public boolean hasCreditcardapprovalcode() {
      return fieldSetFlags()[12];
    }


    /**
      * Clears the value of the 'creditcardapprovalcode' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearCreditcardapprovalcode() {
      creditcardapprovalcode = null;
      fieldSetFlags()[12] = false;
      return this;
    }

    /**
      * Gets the value of the 'currencyrateid' field.
      * @return The value.
      */
    public java.lang.Integer getCurrencyrateid() {
      return currencyrateid;
    }

    /**
      * Sets the value of the 'currencyrateid' field.
      * @param value The value of 'currencyrateid'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setCurrencyrateid(java.lang.Integer value) {
      validate(fields()[13], value);
      this.currencyrateid = value;
      fieldSetFlags()[13] = true;
      return this;
    }

    /**
      * Checks whether the 'currencyrateid' field has been set.
      * @return True if the 'currencyrateid' field has been set, false otherwise.
      */
    public boolean hasCurrencyrateid() {
      return fieldSetFlags()[13];
    }


    /**
      * Clears the value of the 'currencyrateid' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearCurrencyrateid() {
      currencyrateid = null;
      fieldSetFlags()[13] = false;
      return this;
    }

    /**
      * Gets the value of the 'subtotal' field.
      * @return The value.
      */
    public java.lang.Double getSubtotal() {
      return subtotal;
    }

    /**
      * Sets the value of the 'subtotal' field.
      * @param value The value of 'subtotal'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setSubtotal(double value) {
      validate(fields()[14], value);
      this.subtotal = value;
      fieldSetFlags()[14] = true;
      return this;
    }

    /**
      * Checks whether the 'subtotal' field has been set.
      * @return True if the 'subtotal' field has been set, false otherwise.
      */
    public boolean hasSubtotal() {
      return fieldSetFlags()[14];
    }


    /**
      * Clears the value of the 'subtotal' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearSubtotal() {
      fieldSetFlags()[14] = false;
      return this;
    }

    /**
      * Gets the value of the 'taxamt' field.
      * @return The value.
      */
    public java.lang.Double getTaxamt() {
      return taxamt;
    }

    /**
      * Sets the value of the 'taxamt' field.
      * @param value The value of 'taxamt'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setTaxamt(double value) {
      validate(fields()[15], value);
      this.taxamt = value;
      fieldSetFlags()[15] = true;
      return this;
    }

    /**
      * Checks whether the 'taxamt' field has been set.
      * @return True if the 'taxamt' field has been set, false otherwise.
      */
    public boolean hasTaxamt() {
      return fieldSetFlags()[15];
    }


    /**
      * Clears the value of the 'taxamt' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearTaxamt() {
      fieldSetFlags()[15] = false;
      return this;
    }

    /**
      * Gets the value of the 'freight' field.
      * @return The value.
      */
    public java.lang.Double getFreight() {
      return freight;
    }

    /**
      * Sets the value of the 'freight' field.
      * @param value The value of 'freight'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setFreight(double value) {
      validate(fields()[16], value);
      this.freight = value;
      fieldSetFlags()[16] = true;
      return this;
    }

    /**
      * Checks whether the 'freight' field has been set.
      * @return True if the 'freight' field has been set, false otherwise.
      */
    public boolean hasFreight() {
      return fieldSetFlags()[16];
    }


    /**
      * Clears the value of the 'freight' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearFreight() {
      fieldSetFlags()[16] = false;
      return this;
    }

    /**
      * Gets the value of the 'totaldue' field.
      * @return The value.
      */
    public java.lang.Double getTotaldue() {
      return totaldue;
    }

    /**
      * Sets the value of the 'totaldue' field.
      * @param value The value of 'totaldue'.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder setTotaldue(java.lang.Double value) {
      validate(fields()[17], value);
      this.totaldue = value;
      fieldSetFlags()[17] = true;
      return this;
    }

    /**
      * Checks whether the 'totaldue' field has been set.
      * @return True if the 'totaldue' field has been set, false otherwise.
      */
    public boolean hasTotaldue() {
      return fieldSetFlags()[17];
    }


    /**
      * Clears the value of the 'totaldue' field.
      * @return This builder.
      */
    public de.smava.data.vault20.sat_salesorder_1.Builder clearTotaldue() {
      totaldue = null;
      fieldSetFlags()[17] = false;
      return this;
    }

    @Override
    @SuppressWarnings("unchecked")
    public sat_salesorder_1 build() {
      try {
        sat_salesorder_1 record = new sat_salesorder_1();
        record.hkey_salesorder = fieldSetFlags()[0] ? this.hkey_salesorder : (java.lang.String) defaultValue(fields()[0], record.getConversion(0));
        record.record_source = fieldSetFlags()[1] ? this.record_source : (java.lang.String) defaultValue(fields()[1], record.getConversion(1));
        record.load_dtm = fieldSetFlags()[2] ? this.load_dtm : (org.joda.time.DateTime) defaultValue(fields()[2], record.getConversion(2));
        record.load_end_dtm = fieldSetFlags()[3] ? this.load_end_dtm : (org.joda.time.DateTime) defaultValue(fields()[3], record.getConversion(3));
        record.revisionnumber = fieldSetFlags()[4] ? this.revisionnumber : (java.lang.Integer) defaultValue(fields()[4], record.getConversion(4));
        record.orderdate = fieldSetFlags()[5] ? this.orderdate : (org.joda.time.DateTime) defaultValue(fields()[5], record.getConversion(5));
        record.duedate = fieldSetFlags()[6] ? this.duedate : (org.joda.time.DateTime) defaultValue(fields()[6], record.getConversion(6));
        record.shipdate = fieldSetFlags()[7] ? this.shipdate : (org.joda.time.DateTime) defaultValue(fields()[7], record.getConversion(7));
        record.status = fieldSetFlags()[8] ? this.status : (java.lang.Integer) defaultValue(fields()[8], record.getConversion(8));
        record.onlineorderflag = fieldSetFlags()[9] ? this.onlineorderflag : (java.lang.Boolean) defaultValue(fields()[9], record.getConversion(9));
        record.purchaseordernumber = fieldSetFlags()[10] ? this.purchaseordernumber : (java.lang.String) defaultValue(fields()[10], record.getConversion(10));
        record.accountnumber = fieldSetFlags()[11] ? this.accountnumber : (java.lang.String) defaultValue(fields()[11], record.getConversion(11));
        record.creditcardapprovalcode = fieldSetFlags()[12] ? this.creditcardapprovalcode : (java.lang.String) defaultValue(fields()[12], record.getConversion(12));
        record.currencyrateid = fieldSetFlags()[13] ? this.currencyrateid : (java.lang.Integer) defaultValue(fields()[13], record.getConversion(13));
        record.subtotal = fieldSetFlags()[14] ? this.subtotal : (java.lang.Double) defaultValue(fields()[14], record.getConversion(14));
        record.taxamt = fieldSetFlags()[15] ? this.taxamt : (java.lang.Double) defaultValue(fields()[15], record.getConversion(15));
        record.freight = fieldSetFlags()[16] ? this.freight : (java.lang.Double) defaultValue(fields()[16], record.getConversion(16));
        record.totaldue = fieldSetFlags()[17] ? this.totaldue : (java.lang.Double) defaultValue(fields()[17], record.getConversion(17));
        return record;
      } catch (org.apache.avro.AvroMissingFieldException e) {
        throw e;
      } catch (java.lang.Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }

  @SuppressWarnings("unchecked")
  private static final org.apache.avro.io.DatumWriter<sat_salesorder_1>
    WRITER$ = (org.apache.avro.io.DatumWriter<sat_salesorder_1>)MODEL$.createDatumWriter(SCHEMA$);

  @Override public void writeExternal(java.io.ObjectOutput out)
    throws java.io.IOException {
    WRITER$.write(this, SpecificData.getEncoder(out));
  }

  @SuppressWarnings("unchecked")
  private static final org.apache.avro.io.DatumReader<sat_salesorder_1>
    READER$ = (org.apache.avro.io.DatumReader<sat_salesorder_1>)MODEL$.createDatumReader(SCHEMA$);

  @Override public void readExternal(java.io.ObjectInput in)
    throws java.io.IOException {
    READER$.read(this, SpecificData.getDecoder(in));
  }

}

Reply via email to