func (dnm *DuplicateNumberMessage) Update() *DuplicateNumberMessageUpdateOne {
	return (&DuplicateNumberMessageClient{config: dnm.config}).UpdateOne(dnm)
}
Update returns a builder for updating this DuplicateNumberMessage.
Note that you need to call DuplicateNumberMessage.Unwrap() before calling this method if this DuplicateNumberMessage
was returned from a transaction, and the transaction was committed or rolled back.
package ent
import (
	"fmt"
	"strings"
	"entgo.io/contrib/entproto/internal/entprototest/ent/duplicatenumbermessage"
	"entgo.io/ent/dialect/sql"
)
type DuplicateNumberMessage struct {
	config `json:"-"`
	ID int `json:"id,omitempty"`
	Hello string `json:"hello,omitempty"`
	World string `json:"world,omitempty"`
}
func (*DuplicateNumberMessage) scanValues(columns []string) ([]interface{}, error) {
	values := make([]interface{}, len(columns))
	for i := range columns {
		switch columns[i] {
		case duplicatenumbermessage.FieldID:
			values[i] = new(sql.NullInt64)
		case duplicatenumbermessage.FieldHello, duplicatenumbermessage.FieldWorld:
			values[i] = new(sql.NullString)
		default:
			return nil, fmt.Errorf("unexpected column %q for type DuplicateNumberMessage", columns[i])
		}
	}
	return values, nil
}
func (dnm *DuplicateNumberMessage) assignValues(columns []string, values []interface{}) error {
	if m, n := len(values), len(columns); m < n {
		return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
	}
	for i := range columns {
		switch columns[i] {
		case duplicatenumbermessage.FieldID:
			value, ok := values[i].(*sql.NullInt64)
			if !ok {
				return fmt.Errorf("unexpected type %T for field id", value)
			}
			dnm.ID = int(value.Int64)
		case duplicatenumbermessage.FieldHello:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field hello", values[i])
			} else if value.Valid {
				dnm.Hello = value.String
			}
		case duplicatenumbermessage.FieldWorld:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field world", values[i])
			} else if value.Valid {
				dnm.World = value.String
			}
		}
	}
	return nil
}