func (o *DesignPattern) SetPollsFactorsPositions(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*PollsFactorsPosition) error {
	query := "update \"polls_factors_positions\" set \"design_pattern_id\" = null where \"design_pattern_id\" = $1"
	values := []interface{}{o.DesignPatternID}
	if boil.DebugMode {
		fmt.Fprintln(boil.DebugWriter, query)
		fmt.Fprintln(boil.DebugWriter, values)
	}

	_, err := exec.ExecContext(ctx, query, values...)
	if err != nil {
		return errors.Wrap(err, "failed to remove relationships before set")
	}

	if o.R != nil {
		for _, rel := range o.R.PollsFactorsPositions {
			queries.SetScanner(&rel.DesignPatternID, nil)
			if rel.R == nil {
				continue
			}

			rel.R.DesignPattern = nil
		}

		o.R.PollsFactorsPositions = nil
	}
	return o.AddPollsFactorsPositions(ctx, exec, insert, related...)
}
// SetPollsFactorsPositions removes all previously related items of the
// design_pattern replacing them completely with the passed
// in related items, optionally inserting them as new records.
// Sets o.R.DesignPattern's PollsFactorsPositions accordingly.
// Replaces o.R.PollsFactorsPositions with related.
// Sets related.R.DesignPattern's PollsFactorsPositions accordingly.
SetPollsFactorsPositions removes all previously related items of the
design_pattern replacing them completely with the passed
in related items, optionally inserting them as new records.
Sets o.R.DesignPattern's PollsFactorsPositions accordingly.
Replaces o.R.PollsFactorsPositions with related.
Sets related.R.DesignPattern's PollsFactorsPositions accordingly.
// SetPollsFactorsPositions removes all previously related items of the // design_pattern replacing them completely with the passed // in related items optionally inserting them as new records . // Sets o . R . DesignPattern ' s PollsFactorsPositions accordingly . // Replaces o . R . PollsFactorsPositions with related . // Sets related . R . DesignPattern ' s PollsFactorsPositions accordingly .
func (o *DesignPattern) SetPollsFactorsPositions(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*PollsFactorsPosition) error {
	query := "update \"polls_factors_positions\" set \"design_pattern_id\" = null where \"design_pattern_id\" = $1"
	values := []interface{}{o.DesignPatternID}
	if boil.DebugMode {
		fmt.Fprintln(boil.DebugWriter, query)
		fmt.Fprintln(boil.DebugWriter, values)
	}
	_, err := exec.ExecContext(ctx, query, values...)
	if err != nil {
		return errors.Wrap(err, "failed to remove relationships before set")
	}
	if o.R != nil {
		for _, rel := range o.R.PollsFactorsPositions {
			queries.SetScanner(&rel.DesignPatternID, nil)
			if rel.R == nil {
				continue
			}
			rel.R.DesignPattern = nil
		}
		o.R.PollsFactorsPositions = nil
	}
	return o.AddPollsFactorsPositions(ctx, exec, insert, related...)
}
func ( o * DesignPattern ) SetPollsFactorsPositions ( ctx context . Context , exec boil . ContextExecutor , insert bool , related ... * PollsFactorsPosition ) error { query := " \" \" \" \" \" \" " values := [ ] interface { } { o . DesignPatternID } if boil . DebugMode { fmt . Fprintln ( boil . DebugWriter , query ) fmt . Fprintln ( boil . DebugWriter , values ) } _ , err := exec . ExecContext ( ctx , query , values ... ) if err != nil { return errors . Wrap ( err , " " ) } if o . R != nil { for _ , rel := range o . R . PollsFactorsPositions { queries . SetScanner ( & rel . DesignPatternID , nil ) if rel . R == nil { continue } rel . R . DesignPattern = nil } o . R . PollsFactorsPositions = nil } return o . AddPollsFactorsPositions ( ctx , exec , insert , related ... ) }
SetPollsFactorsPositions removes all previously related items of the
design_pattern replacing them completely with the passed
in related items, optionally inserting them as new records.
SetPollsFactorsPositions removes all previously related items of the design_pattern replacing them completely with the passed in related items optionally inserting them as new records .