func (uu *UserUpdate) SaveX(ctx context.Context) int {
	affected, err := uu.Save(ctx)
	if err != nil {
		panic(err)
	}
	return affected
}
SaveX is like Save, but panics if an error occurs.
package ent
import (
	"context"
	"fmt"
	"entgo.io/contrib/entproto/internal/entprototest/ent/blogpost"
	"entgo.io/contrib/entproto/internal/entprototest/ent/image"
	"entgo.io/contrib/entproto/internal/entprototest/ent/predicate"
	"entgo.io/contrib/entproto/internal/entprototest/ent/user"
	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"entgo.io/ent/schema/field"
	"github.com/google/uuid"
)
type UserUpdate struct {
	config
	hooks    []Hook
	mutation *UserMutation
}
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate {
	uu.mutation.Where(ps...)
	return uu
}
func (uu *UserUpdate) SetUserName(s string) *UserUpdate {
	uu.mutation.SetUserName(s)
	return uu
}
func (uu *UserUpdate) SetStatus(u user.Status) *UserUpdate {
	uu.mutation.SetStatus(u)
	return uu
}
func (uu *UserUpdate) AddBlogPostIDs(ids ...int) *UserUpdate {
	uu.mutation.AddBlogPostIDs(ids...)
	return uu
}
func (uu *UserUpdate) AddBlogPosts(b ...*BlogPost) *UserUpdate {
	ids := make([]int, len(b))
	for i := range b {
		ids[i] = b[i].ID
	}
	return uu.AddBlogPostIDs(ids...)
}
func (uu *UserUpdate) SetProfilePicID(id uuid.UUID) *UserUpdate {
	uu.mutation.SetProfilePicID(id)
	return uu
}
func (uu *UserUpdate) SetNillableProfilePicID(id *uuid.UUID) *UserUpdate {
	if id != nil {
		uu = uu.SetProfilePicID(*id)
	}
	return uu
}
func (uu *UserUpdate) SetProfilePic(i *Image) *UserUpdate {
	return uu.SetProfilePicID(i.ID)
}
func (uu *UserUpdate) Mutation() *UserMutation {
	return uu.mutation
}
func (uu *UserUpdate) ClearBlogPosts() *UserUpdate {
	uu.mutation.ClearBlogPosts()
	return uu
}
func (uu *UserUpdate) RemoveBlogPostIDs(ids ...int) *UserUpdate {
	uu.mutation.RemoveBlogPostIDs(ids...)
	return uu
}
func (uu *UserUpdate) RemoveBlogPosts(b ...*BlogPost) *UserUpdate {
	ids := make([]int, len(b))
	for i := range b {
		ids[i] = b[i].ID
	}
	return uu.RemoveBlogPostIDs(ids...)
}
func (uu *UserUpdate) ClearProfilePic() *UserUpdate {
	uu.mutation.ClearProfilePic()
	return uu
}
func (uu *UserUpdate) Save(ctx context.Context) (int, error) {
	var (
		err      error
		affected int
	)
	if len(uu.hooks) == 0 {
		if err = uu.check(); err != nil {
			return 0, err
		}
		affected, err = uu.sqlSave(ctx)
	} else {
		var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
			mutation, ok := m.(*UserMutation)
			if !ok {
				return nil, fmt.Errorf("unexpected mutation type %T", m)
			}
			if err = uu.check(); err != nil {
				return 0, err
			}
			uu.mutation = mutation
			affected, err = uu.sqlSave(ctx)
			mutation.done = true
			return affected, err
		})
		for i := len(uu.hooks) - 1; i >= 0; i-- {
			if uu.hooks[i] == nil {
				return 0, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)")
			}
			mut = uu.hooks[i](mut)
		}
		if _, err := mut.Mutate(ctx, uu.mutation); err != nil {
			return 0, err
		}
	}
	return affected, err
}