func (a *Address) Update() *AddressUpdateOne {
	return (&AddressClient{config: a.config}).UpdateOne(a)
}
Update returns a builder for updating this Address.
Note that you need to call Address.Unwrap() before calling this method if this Address
was returned from a transaction, and the transaction was committed or rolled back.
package ent
import (
	"fmt"
	"strings"
	"time"
	"entgo.io/ent/dialect/sql"
	"github.com/go-kratos/beer-shop/app/user/service/internal/data/ent/address"
	"github.com/go-kratos/beer-shop/app/user/service/internal/data/ent/user"
)
type Address struct {
	config `json:"-"`
	ID int64 `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
	Mobile string `json:"mobile,omitempty"`
	Address string `json:"address,omitempty"`
	PostCode string `json:"post_code,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	Edges          AddressEdges `json:"edges"`
	user_addresses *int64
}
type AddressEdges struct {
	User *User `json:"user,omitempty"`
	loadedTypes [1]bool
}
func (e AddressEdges) UserOrErr() (*User, error) {
	if e.loadedTypes[0] {
		if e.User == nil {
			return nil, &NotFoundError{label: user.Label}
		}
		return e.User, nil
	}
	return nil, &NotLoadedError{edge: "user"}
}
func (*Address) scanValues(columns []string) ([]interface{}, error) {
	values := make([]interface{}, len(columns))
	for i := range columns {
		switch columns[i] {
		case address.FieldID:
			values[i] = &sql.NullInt64{}
		case address.FieldName, address.FieldMobile, address.FieldAddress, address.FieldPostCode:
			values[i] = &sql.NullString{}
		case address.FieldCreatedAt, address.FieldUpdatedAt:
			values[i] = &sql.NullTime{}
		case address.ForeignKeys[0]:  
			values[i] = &sql.NullInt64{}
		default:
			return nil, fmt.Errorf("unexpected column %q for type Address", columns[i])
		}
	}
	return values, nil
}
func (a *Address) 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 address.FieldID:
			value, ok := values[i].(*sql.NullInt64)
			if !ok {
				return fmt.Errorf("unexpected type %T for field id", value)
			}
			a.ID = int64(value.Int64)
		case address.FieldName:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field name", values[i])
			} else if value.Valid {
				a.Name = value.String
			}
		case address.FieldMobile:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field mobile", values[i])
			} else if value.Valid {
				a.Mobile = value.String
			}
		case address.FieldAddress:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field address", values[i])
			} else if value.Valid {
				a.Address = value.String
			}
		case address.FieldPostCode:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field post_code", values[i])
			} else if value.Valid {
				a.PostCode = value.String
			}
		case address.FieldCreatedAt:
			if value, ok := values[i].(*sql.NullTime); !ok {
				return fmt.Errorf("unexpected type %T for field created_at", values[i])
			} else if value.Valid {
				a.CreatedAt = value.Time
			}
		case address.FieldUpdatedAt:
			if value, ok := values[i].(*sql.NullTime); !ok {
				return fmt.Errorf("unexpected type %T for field updated_at", values[i])
			} else if value.Valid {
				a.UpdatedAt = value.Time
			}
		case address.ForeignKeys[0]:
			if value, ok := values[i].(*sql.NullInt64); !ok {
				return fmt.Errorf("unexpected type %T for edge-field user_addresses", value)
			} else if value.Valid {
				a.user_addresses = new(int64)
				*a.user_addresses = int64(value.Int64)
			}
		}
	}
	return nil
}
func (a *Address) QueryUser() *UserQuery {
	return (&AddressClient{config: a.config}).QueryUser(a)
}