func (cu *CustomerUpdate) Save(ctx context.Context) (int, error) {
	if cu.update_time == nil {
		v := customer.UpdateDefaultUpdateTime()
		cu.update_time = &v
	}
	if cu.name != nil {
		if err := customer.NameValidator(*cu.name); err != nil {
			return 0, fmt.Errorf("ent: validator failed for field \"name\": %v", err)
		}
	}
	if cu.external_id != nil {
		if err := customer.ExternalIDValidator(*cu.external_id); err != nil {
			return 0, fmt.Errorf("ent: validator failed for field \"external_id\": %v", err)
		}
	}
	return cu.sqlSave(ctx)
}
// Save executes the query and returns the number of rows/vertices matched by this operation.
Save executes the query and returns the number of rows/vertices matched by this operation.
// Save executes the query and returns the number of rows / vertices matched by this operation .
func (cu *CustomerUpdate) Save(ctx context.Context) (int, error) {
	if cu.update_time == nil {
		v := customer.UpdateDefaultUpdateTime()
		cu.update_time = &v
	}
	if cu.name != nil {
		if err := customer.NameValidator(*cu.name); err != nil {
			return 0, fmt.Errorf("ent: validator failed for field \"name\": %v", err)
		}
	}
	if cu.external_id != nil {
		if err := customer.ExternalIDValidator(*cu.external_id); err != nil {
			return 0, fmt.Errorf("ent: validator failed for field \"external_id\": %v", err)
		}
	}
	return cu.sqlSave(ctx)
}
func ( cu * CustomerUpdate ) Save ( ctx context . Context ) ( int , error ) { if cu . update_time == nil { v := customer . UpdateDefaultUpdateTime ( ) cu . update_time = & v } if cu . name != nil { if err := customer . NameValidator ( * cu . name ) ; err != nil { return 0 , fmt . Errorf ( " \" \" " , err ) } } if cu . external_id != nil { if err := customer . ExternalIDValidator ( * cu . external_id ) ; err != nil { return 0 , fmt . Errorf ( " \" \" " , err ) } } return cu . sqlSave ( ctx ) }
Save executes the query and returns the number of rows/vertices matched by this operation.
Save executes the query and returns the number of rows / vertices matched by this operation .