func (o *Factor) SetParentFactorFactors(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Factor) error {
	query := "update \"factors\" set \"parent_factor_id\" = null where \"parent_factor_id\" = $1"
	values := []interface{}{o.FactorID}
	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.ParentFactorFactors {
			queries.SetScanner(&rel.ParentFactorID, nil)
			if rel.R == nil {
				continue
			}

			rel.R.ParentFactor = nil
		}

		o.R.ParentFactorFactors = nil
	}
	return o.AddParentFactorFactors(ctx, exec, insert, related...)
}
// SetParentFactorFactors removes all previously related items of the
// factor replacing them completely with the passed
// in related items, optionally inserting them as new records.
// Sets o.R.ParentFactor's ParentFactorFactors accordingly.
// Replaces o.R.ParentFactorFactors with related.
// Sets related.R.ParentFactor's ParentFactorFactors accordingly.
SetParentFactorFactors removes all previously related items of the
factor replacing them completely with the passed
in related items, optionally inserting them as new records.
Sets o.R.ParentFactor's ParentFactorFactors accordingly.
Replaces o.R.ParentFactorFactors with related.
Sets related.R.ParentFactor's ParentFactorFactors accordingly.
// SetParentFactorFactors removes all previously related items of the // factor replacing them completely with the passed // in related items optionally inserting them as new records . // Sets o . R . ParentFactor ' s ParentFactorFactors accordingly . // Replaces o . R . ParentFactorFactors with related . // Sets related . R . ParentFactor ' s ParentFactorFactors accordingly .
func (o *Factor) SetParentFactorFactors(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Factor) error {
	query := "update \"factors\" set \"parent_factor_id\" = null where \"parent_factor_id\" = $1"
	values := []interface{}{o.FactorID}
	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.ParentFactorFactors {
			queries.SetScanner(&rel.ParentFactorID, nil)
			if rel.R == nil {
				continue
			}
			rel.R.ParentFactor = nil
		}
		o.R.ParentFactorFactors = nil
	}
	return o.AddParentFactorFactors(ctx, exec, insert, related...)
}
func ( o * Factor ) SetParentFactorFactors ( ctx context . Context , exec boil . ContextExecutor , insert bool , related ... * Factor ) error { query := " \" \" \" \" \" \" " values := [ ] interface { } { o . FactorID } 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 . ParentFactorFactors { queries . SetScanner ( & rel . ParentFactorID , nil ) if rel . R == nil { continue } rel . R . ParentFactor = nil } o . R . ParentFactorFactors = nil } return o . AddParentFactorFactors ( ctx , exec , insert , related ... ) }
SetParentFactorFactors removes all previously related items of the
factor replacing them completely with the passed
in related items, optionally inserting them as new records.
SetParentFactorFactors removes all previously related items of the factor replacing them completely with the passed in related items optionally inserting them as new records .