func (mwpnc *MessageWithPackageNameCreate) Exec(ctx context.Context) error {
	_, err := mwpnc.Save(ctx)
	return err
}
Exec executes the query.
package ent
import (
	"context"
	"errors"
	"fmt"
	"entgo.io/contrib/entproto/internal/entprototest/ent/messagewithpackagename"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"entgo.io/ent/schema/field"
)
type MessageWithPackageNameCreate struct {
	config
	mutation *MessageWithPackageNameMutation
	hooks    []Hook
}
func (mwpnc *MessageWithPackageNameCreate) SetName(s string) *MessageWithPackageNameCreate {
	mwpnc.mutation.SetName(s)
	return mwpnc
}
func (mwpnc *MessageWithPackageNameCreate) Mutation() *MessageWithPackageNameMutation {
	return mwpnc.mutation
}
func (mwpnc *MessageWithPackageNameCreate) Save(ctx context.Context) (*MessageWithPackageName, error) {
	var (
		err  error
		node *MessageWithPackageName
	)
	if len(mwpnc.hooks) == 0 {
		if err = mwpnc.check(); err != nil {
			return nil, err
		}
		node, err = mwpnc.sqlSave(ctx)
	} else {
		var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
			mutation, ok := m.(*MessageWithPackageNameMutation)
			if !ok {
				return nil, fmt.Errorf("unexpected mutation type %T", m)
			}
			if err = mwpnc.check(); err != nil {
				return nil, err
			}
			mwpnc.mutation = mutation
			if node, err = mwpnc.sqlSave(ctx); err != nil {
				return nil, err
			}
			mutation.id = &node.ID
			mutation.done = true
			return node, err
		})
		for i := len(mwpnc.hooks) - 1; i >= 0; i-- {
			if mwpnc.hooks[i] == nil {
				return nil, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)")
			}
			mut = mwpnc.hooks[i](mut)
		}
		if _, err := mut.Mutate(ctx, mwpnc.mutation); err != nil {
			return nil, err
		}
	}
	return node, err
}
func (mwpnc *MessageWithPackageNameCreate) SaveX(ctx context.Context) *MessageWithPackageName {
	v, err := mwpnc.Save(ctx)
	if err != nil {
		panic(err)
	}
	return v
}