toColumnValue(propertyDef, value) {
    debug('IBMiConnector.prototype.toColumnValue prop=%j value=%j', propertyDef, value);
    if (value === null) {
      if (propertyDef.autoIncrement || propertyDef.id) {
        return new ParameterizedSQL('DEFAULT');
      }
      return null;
    }
    if (!propertyDef) {
      return value;
    }
    switch (propertyDef.type.name) {
      default:
      case 'Array':
      case 'Number':
      case 'String':
        return value;
      case 'Boolean':
        return Number(value);
      case 'Object':
      case 'ModelConstructor':
        return JSON.stringify(value);
      case 'JSON':
        return String(value);
      // TODO: Figure out date
      // case 'Date':
      //   return dateToDB2(value);
    }
  }
/**
   * Converts a model property value into the form required by the
   * database column. The result should be one of following forms:
   *
   * - {sql: "point(?,?)", params:[10,20]}
   * - {sql: "'John'", params: []}
   * - "John"
   *
   * @param {Object} propertyDef Model property definition
   * @param {*} value Model property value
   * @returns {ParameterizedSQL|*} Database column value.
   *
   */
Converts a model property value into the form required by the
database column. The result should be one of following forms.



@param {Object} propertyDef Model property definition
@param {*} value Model property value
@returns {ParameterizedSQL|*} Database column value.
Converts a model property value into the form required by the database column . The result should be one of following forms . @param { Object } propertyDef Model property definition @param { * } value Model property value @returns { ParameterizedSQL| * } Database column value .
toColumnValue(propertyDef, value) {
    debug('IBMiConnector.prototype.toColumnValue prop=%j value=%j', propertyDef, value);
    if (value === null) {
      if (propertyDef.autoIncrement || propertyDef.id) {
        return new ParameterizedSQL('DEFAULT');
      }
      return null;
    }
    if (!propertyDef) {
      return value;
    }
    switch (propertyDef.type.name) {
      default:
      case 'Array':
      case 'Number':
      case 'String':
        return value;
      case 'Boolean':
        return Number(value);
      case 'Object':
      case 'ModelConstructor':
        return JSON.stringify(value);
      case 'JSON':
        return String(value);
    }
  }
toColumnValue ( propertyDef , value ) { debug ( 'IBMiConnector.prototype.toColumnValue prop=%j value=%j' , propertyDef , value ) ; if ( value === null ) { if ( propertyDef . autoIncrement || propertyDef . id ) { return new ParameterizedSQL ( 'DEFAULT' ) ; } return null ; } if ( ! propertyDef ) { return value ; } switch ( propertyDef . type . name ) { default : case 'Array' : case 'Number' : case 'String' : return value ; case 'Boolean' : return Number ( value ) ; case 'Object' : case 'ModelConstructor' : return JSON . stringify ( value ) ; case 'JSON' : return String ( value ) ; } }
Converts a model property value into the form required by the
 database column.
Converts a model property value into the form required by the database column .
// TODO: Figure out date // case 'Date': //   return dateToDB2(value);