func (mwpn *MessageWithPackageName) Unwrap() *MessageWithPackageName {
	tx, ok := mwpn.config.driver.(*txDriver)
	if !ok {
		panic("ent: MessageWithPackageName is not a transactional entity")
	}
	mwpn.config.driver = tx.drv
	return mwpn
}
Unwrap unwraps the MessageWithPackageName entity that was returned from a transaction after it was closed,
so that all future queries will be executed through the driver which created the transaction.
package ent
import (
	"fmt"
	"strings"
	"entgo.io/contrib/entproto/internal/entprototest/ent/messagewithpackagename"
	"entgo.io/ent/dialect/sql"
)
type MessageWithPackageName struct {
	config `json:"-"`
	ID int `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}
func (*MessageWithPackageName) scanValues(columns []string) ([]interface{}, error) {
	values := make([]interface{}, len(columns))
	for i := range columns {
		switch columns[i] {
		case messagewithpackagename.FieldID:
			values[i] = new(sql.NullInt64)
		case messagewithpackagename.FieldName:
			values[i] = new(sql.NullString)
		default:
			return nil, fmt.Errorf("unexpected column %q for type MessageWithPackageName", columns[i])
		}
	}
	return values, nil
}
func (mwpn *MessageWithPackageName) 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 messagewithpackagename.FieldID:
			value, ok := values[i].(*sql.NullInt64)
			if !ok {
				return fmt.Errorf("unexpected type %T for field id", value)
			}
			mwpn.ID = int(value.Int64)
		case messagewithpackagename.FieldName:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field name", values[i])
			} else if value.Valid {
				mwpn.Name = value.String
			}
		}
	}
	return nil
}
func (mwpn *MessageWithPackageName) Update() *MessageWithPackageNameUpdateOne {
	return (&MessageWithPackageNameClient{config: mwpn.config}).UpdateOne(mwpn)
}