// SetFieldValue implements mapping.Fielder interface.
SetFieldValue implements mapping.Fielder interface.
// SetFieldValue implements mapping . Fielder interface .
func (c *Comment) SetFieldValue(field *mapping.StructField, value interface{}) (err error) {
	switch field.Index[0] {
	case 0: 
		if v, ok := value.(int); ok {
			c.ID = v
			return nil
		}
		if field.DatabaseNotNull() && value == nil {
			c.ID = 0
			return nil
		}
		switch v := value.(type) {
		case int8:
			c.ID = int(v)
		case int16:
			c.ID = int(v)
		case int32:
			c.ID = int(v)
		case int64:
			c.ID = int(v)
		case uint:
			c.ID = int(v)
		case uint8:
			c.ID = int(v)
		case uint16:
			c.ID = int(v)
		case uint32:
			c.ID = int(v)
		case uint64:
			c.ID = int(v)
		case float32:
			c.ID = int(v)
		case float64:
			c.ID = int(v)
		default:
			return errors.Wrapf(mapping.ErrFieldValue, "provided invalid field type: '%T' for the field: %s", value, field.Name())
		}
		return nil
	case 1: 
		if v, ok := value.(string); ok {
			c.Body = v
			return nil
		}
		if field.DatabaseNotNull() && value == nil {
			c.Body = ""
			return nil
		}
		if v, ok := value.([]byte); ok {
			c.Body = string(v)
			return nil
		}
		return errors.Wrapf(mapping.ErrFieldValue, "provided invalid field type: '%T' for the field: %s", value, field.Name())
	case 3: 
		if value == nil {
			c.PostID = nil
			return nil
		}
		if v, ok := value.(*int); ok {
			c.PostID = v
			return nil
		}
		if v, ok := value.(int); ok {
			c.PostID = &v
			return nil
		}
		switch v := value.(type) {
		case int8:
			temp := int(v)
			c.PostID = &temp
		case *int8:
			temp := int(*v)
			c.PostID = &temp
		case int16:
			temp := int(v)
			c.PostID = &temp
		case *int16:
			temp := int(*v)
			c.PostID = &temp
		case int32:
			temp := int(v)
			c.PostID = &temp
		case *int32:
			temp := int(*v)
			c.PostID = &temp
		case int64:
			temp := int(v)
			c.PostID = &temp
		case *int64:
			temp := int(*v)
			c.PostID = &temp
		case uint:
			temp := int(v)
			c.PostID = &temp
		case *uint:
			temp := int(*v)
			c.PostID = &temp
		case uint8:
			temp := int(v)
			c.PostID = &temp
		case *uint8:
			temp := int(*v)
			c.PostID = &temp
		case uint16:
			temp := int(v)
			c.PostID = &temp
		case *uint16:
			temp := int(*v)
			c.PostID = &temp
		case uint32:
			temp := int(v)
			c.PostID = &temp
		case *uint32:
			temp := int(*v)
			c.PostID = &temp
		case uint64:
			temp := int(v)
			c.PostID = &temp
		case *uint64:
			temp := int(*v)
			c.PostID = &temp
		case float32:
			temp := int(v)
			c.PostID = &temp
		case *float32:
			temp := int(*v)
			c.PostID = &temp
		case float64:
			temp := int(v)
			c.PostID = &temp
		case *float64:
			temp := int(*v)
			c.PostID = &temp
		default:
			return errors.Wrapf(mapping.ErrFieldValue, "provided invalid field type: '%T' for the field: %s", value, field.Name())
		}
		return nil
	default:
		return errors.Wrapf(mapping.ErrInvalidModelField, "provided invalid field: '%s' for the model: 'Comment'", field.Name())
	}
}
func ( c * Comment ) SetFieldValue ( field * mapping . StructField , value interface { } ) ( err error ) { switch field . Index [ 0 ] { case 0 : if v , ok := value . ( int ) ; ok { c . ID = v return nil } if field . DatabaseNotNull ( ) && value == nil { c . ID = 0 return nil } switch v := value . ( type ) { case int8 : c . ID = int ( v ) case int16 : c . ID = int ( v ) case int32 : c . ID = int ( v ) case int64 : c . ID = int ( v ) case uint : c . ID = int ( v ) case uint8 : c . ID = int ( v ) case uint16 : c . ID = int ( v ) case uint32 : c . ID = int ( v ) case uint64 : c . ID = int ( v ) case float32 : c . ID = int ( v ) case float64 : c . ID = int ( v ) default : return errors . Wrapf ( mapping . ErrFieldValue , " " , value , field . Name ( ) ) } return nil case 1 : if v , ok := value . ( string ) ; ok { c . Body = v return nil } if field . DatabaseNotNull ( ) && value == nil { c . Body = " " return nil } if v , ok := value . ( [ ] byte ) ; ok { c . Body = string ( v ) return nil } return errors . Wrapf ( mapping . ErrFieldValue , " " , value , field . Name ( ) ) case 3 : if value == nil { c . PostID = nil return nil } if v , ok := value . ( * int ) ; ok { c . PostID = v return nil } if v , ok := value . ( int ) ; ok { c . PostID = & v return nil } switch v := value . ( type ) { case int8 : temp := int ( v ) c . PostID = & temp case * int8 : temp := int ( * v ) c . PostID = & temp case int16 : temp := int ( v ) c . PostID = & temp case * int16 : temp := int ( * v ) c . PostID = & temp case int32 : temp := int ( v ) c . PostID = & temp case * int32 : temp := int ( * v ) c . PostID = & temp case int64 : temp := int ( v ) c . PostID = & temp case * int64 : temp := int ( * v ) c . PostID = & temp case uint : temp := int ( v ) c . PostID = & temp case * uint : temp := int ( * v ) c . PostID = & temp case uint8 : temp := int ( v ) c . PostID = & temp case * uint8 : temp := int ( * v ) c . PostID = & temp case uint16 : temp := int ( v ) c . PostID = & temp case * uint16 : temp := int ( * v ) c . PostID = & temp case uint32 : temp := int ( v ) c . PostID = & temp case * uint32 : temp := int ( * v ) c . PostID = & temp case uint64 : temp := int ( v ) c . PostID = & temp case * uint64 : temp := int ( * v ) c . PostID = & temp case float32 : temp := int ( v ) c . PostID = & temp case * float32 : temp := int ( * v ) c . PostID = & temp case float64 : temp := int ( v ) c . PostID = & temp case * float64 : temp := int ( * v ) c . PostID = & temp default : return errors . Wrapf ( mapping . ErrFieldValue , " " , value , field . Name ( ) ) } return nil default : return errors . Wrapf ( mapping . ErrInvalidModelField , " " , field . Name ( ) ) } }
SetFieldValue implements mapping.Fielder interface.
SetFieldValue implements mapping . Fielder interface .
// ID // Body // Check alternate types for the Body. // PostID // Check if it is non-pointer value.