func (cuo *CustomerUpdateOne) Save(ctx context.Context) (*Customer, error) {
	if cuo.update_time == nil {
		v := customer.UpdateDefaultUpdateTime()
		cuo.update_time = &v
	}
	if cuo.name != nil {
		if err := customer.NameValidator(*cuo.name); err != nil {
			return nil, fmt.Errorf("ent: validator failed for field \"name\": %v", err)
		}
	}
	if cuo.external_id != nil {
		if err := customer.ExternalIDValidator(*cuo.external_id); err != nil {
			return nil, fmt.Errorf("ent: validator failed for field \"external_id\": %v", err)
		}
	}
	return cuo.sqlSave(ctx)
}
// Save executes the query and returns the updated entity.
Save executes the query and returns the updated entity.
// Save executes the query and returns the updated entity .
func (cuo *CustomerUpdateOne) Save(ctx context.Context) (*Customer, error) {
	if cuo.update_time == nil {
		v := customer.UpdateDefaultUpdateTime()
		cuo.update_time = &v
	}
	if cuo.name != nil {
		if err := customer.NameValidator(*cuo.name); err != nil {
			return nil, fmt.Errorf("ent: validator failed for field \"name\": %v", err)
		}
	}
	if cuo.external_id != nil {
		if err := customer.ExternalIDValidator(*cuo.external_id); err != nil {
			return nil, fmt.Errorf("ent: validator failed for field \"external_id\": %v", err)
		}
	}
	return cuo.sqlSave(ctx)
}
func ( cuo * CustomerUpdateOne ) Save ( ctx context . Context ) ( * Customer , error ) { if cuo . update_time == nil { v := customer . UpdateDefaultUpdateTime ( ) cuo . update_time = & v } if cuo . name != nil { if err := customer . NameValidator ( * cuo . name ) ; err != nil { return nil , fmt . Errorf ( " \" \" " , err ) } } if cuo . external_id != nil { if err := customer . ExternalIDValidator ( * cuo . external_id ) ; err != nil { return nil , fmt . Errorf ( " \" \" " , err ) } } return cuo . sqlSave ( ctx ) }
Save executes the query and returns the updated entity.
Save executes the query and returns the updated entity .