code: func (e *RegisteredEntity) SetFieldValues(entity DomainObject, fieldValues map[string]FieldValue, fieldsToRead []string) {
  	r := reflect.ValueOf(entity).Elem()
  	if fieldsToRead == nil {
  		for columnName := range fieldValues {
  			fieldsToRead = append(fieldsToRead, columnName)
  		}
  	}
  	//for columnName, fieldValue := range fieldValues {
  	for _, columnName := range fieldsToRead {
  		// column name may be different from the entity's field name, so we
  		// have to look it up along the way.
  		fieldName, ok := e.table.ColToField[columnName]
  		if !ok {
  			continue // we ignore fields that we don't know about
  		}
  		fieldValue := fieldValues[columnName]
  		val := r.FieldByName(fieldName)
  		if !val.IsValid() {
  			panic("Field " + fieldName + " is is not a valid field for " + e.table.StructName)
  		}
  
  		var fv reflect.Value
  		if fieldValue != nil {
  			fv = reflect.ValueOf(fieldValue)
  		}
  		if !fv.IsValid() || fv.Kind() == reflect.Ptr && fv.IsNil() {
  			val.Set(reflect.Zero(val.Type()))
  			continue
  		}
  
  		switch val.Type() {
  		case uuidType, boolType, int64Type, stringType, int32Type, doubleType, timestampType, blobType:
  			val.Set(reflect.Indirect(fv))
  		case nullUUIDType, nullStringType, nullInt32Type, nullInt64Type, nullDoubleType, nullBoolType, nullTimeType:
  			if fv.CanAddr() {
  				val.Set(fv.Addr())
  			} else {
  				val.Set(fv)
  			}
  		}
  
  	}
  }
docs: // SetFieldValues is a helper for populating a DOSA entity with the given
  // fieldName->value map