code: func (e *RegisteredEntity) OnlyFieldValues(entity DomainObject, fieldNames []string) (map[string]FieldValue, error) {
  	if fieldNames == nil || len(fieldNames) == 0 {
  		for _, field := range e.table.ColToField {
  			fieldNames = append(fieldNames, field)
  		}
  	}
  	v := reflect.ValueOf(entity).Elem()
  	fieldValues := make(map[string]FieldValue)
  
  	for _, fieldName := range fieldNames {
  		columnName, ok := e.table.FieldToCol[fieldName]
  		if !ok {
  			return nil, errors.Errorf("%s is not a valid field for %s", fieldName, e.table.StructName)
  		}
  		value := v.FieldByName(fieldName)
  		if !value.IsValid() {
  			// this should never happen
  			panic("Field " + fieldName + " is not a valid field for " + e.table.StructName)
  		}
  		fieldValues[columnName] = value.Interface()
  	}
  	return fieldValues, nil
  }
docs: // OnlyFieldValues is a helper for generating a map of field values for a
  // a subset of fields. If a field name provided does not map to an entity
  // field, an error will be returned.