func (contentUnitsPersonL) LoadPerson(e boil.Executor, singular bool, maybeContentUnitsPerson interface{}) error {
	var slice []*ContentUnitsPerson
	var object *ContentUnitsPerson
	count := 1
	if singular {
		object = maybeContentUnitsPerson.(*ContentUnitsPerson)
	} else {
		slice = *maybeContentUnitsPerson.(*[]*ContentUnitsPerson)
		count = len(slice)
	}
	args := make([]interface{}, count)
	if singular {
		if object.R == nil {
			object.R = &contentUnitsPersonR{}
		}
		args[0] = object.PersonID
	} else {
		for i, obj := range slice {
			if obj.R == nil {
				obj.R = &contentUnitsPersonR{}
			}
			args[i] = obj.PersonID
		}
	}
	query := fmt.Sprintf(
		"select * from \"persons\" where \"id\" in (%s)",
		strmangle.Placeholders(dialect.IndexPlaceholders, count, 1, 1),
	)
	if boil.DebugMode {
		fmt.Fprintf(boil.DebugWriter, "%s\n%v\n", query, args)
	}
	results, err := e.Query(query, args...)
	if err != nil {
		return errors.Wrap(err, "failed to eager load Person")
	}
	defer results.Close()
	var resultSlice []*Person
	if err = queries.Bind(results, &resultSlice); err != nil {
		return errors.Wrap(err, "failed to bind eager loaded slice Person")
	}
	if len(resultSlice) == 0 {
		return nil
	}
	if singular {
		object.R.Person = resultSlice[0]
		return nil
	}
	for _, local := range slice {
		for _, foreign := range resultSlice {
			if local.PersonID == foreign.ID {
				local.R.Person = foreign
				break
			}
		}
	}
	return nil
}
LoadPerson allows an eager lookup of values, cached into the
loaded structs of the objects.
package mdbmodels
import (
	"bytes"
	"database/sql"
	"fmt"
	"reflect"
	"strings"
	"sync"
	"time"
	"github.com/Bnei-Baruch/sqlboiler/boil"
	"github.com/Bnei-Baruch/sqlboiler/queries"
	"github.com/Bnei-Baruch/sqlboiler/queries/qm"
	"github.com/Bnei-Baruch/sqlboiler/strmangle"
	"github.com/pkg/errors"
)
type ContentUnitsPerson struct {
	ContentUnitID int64 `boil:"content_unit_id" json:"content_unit_id" toml:"content_unit_id" yaml:"content_unit_id"`
	PersonID      int64 `boil:"person_id" json:"person_id" toml:"person_id" yaml:"person_id"`
	RoleID        int64 `boil:"role_id" json:"role_id" toml:"role_id" yaml:"role_id"`
	R *contentUnitsPersonR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L contentUnitsPersonL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}
var ContentUnitsPersonColumns = struct {
	ContentUnitID string
	PersonID      string
	RoleID        string
}{
	ContentUnitID: "content_unit_id",
	PersonID:      "person_id",
	RoleID:        "role_id",
}
type contentUnitsPersonR struct {
	ContentUnit *ContentUnit
	Person      *Person
	Role        *ContentRoleType
}
type contentUnitsPersonL struct{}
var (
	contentUnitsPersonColumns               = []string{"content_unit_id", "person_id", "role_id"}
	contentUnitsPersonColumnsWithoutDefault = []string{"content_unit_id", "person_id", "role_id"}
	contentUnitsPersonColumnsWithDefault    = []string{}
	contentUnitsPersonPrimaryKeyColumns     = []string{"content_unit_id", "person_id"}
)
type (
	ContentUnitsPersonSlice []*ContentUnitsPerson
	contentUnitsPersonQuery struct {
		*queries.Query
	}
)
var (
	contentUnitsPersonType                 = reflect.TypeOf(&ContentUnitsPerson{})
	contentUnitsPersonMapping              = queries.MakeStructMapping(contentUnitsPersonType)
	contentUnitsPersonPrimaryKeyMapping, _ = queries.BindMapping(contentUnitsPersonType, contentUnitsPersonMapping, contentUnitsPersonPrimaryKeyColumns)
	contentUnitsPersonInsertCacheMut       sync.RWMutex
	contentUnitsPersonInsertCache          = make(map[string]insertCache)
	contentUnitsPersonUpdateCacheMut       sync.RWMutex
	contentUnitsPersonUpdateCache          = make(map[string]updateCache)
	contentUnitsPersonUpsertCacheMut       sync.RWMutex
	contentUnitsPersonUpsertCache          = make(map[string]insertCache)
)
var (
	_ = time.Second
	_ = bytes.MinRead
)
func (q contentUnitsPersonQuery) OneP() *ContentUnitsPerson {
	o, err := q.One()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return o
}
func (q contentUnitsPersonQuery) One() (*ContentUnitsPerson, error) {
	o := &ContentUnitsPerson{}
	queries.SetLimit(q.Query, 1)
	err := q.Bind(o)
	if err != nil {
		if errors.Cause(err) == sql.ErrNoRows {
			return nil, sql.ErrNoRows
		}
		return nil, errors.Wrap(err, "mdbmodels: failed to execute a one query for content_units_persons")
	}
	return o, nil
}
func (q contentUnitsPersonQuery) AllP() ContentUnitsPersonSlice {
	o, err := q.All()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return o
}
func (q contentUnitsPersonQuery) All() (ContentUnitsPersonSlice, error) {
	var o []*ContentUnitsPerson
	err := q.Bind(&o)
	if err != nil {
		return nil, errors.Wrap(err, "mdbmodels: failed to assign all query results to ContentUnitsPerson slice")
	}
	return o, nil
}
func (q contentUnitsPersonQuery) CountP() int64 {
	c, err := q.Count()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return c
}
func (q contentUnitsPersonQuery) Count() (int64, error) {
	var count int64
	queries.SetSelect(q.Query, nil)
	queries.SetCount(q.Query)
	err := q.Query.QueryRow().Scan(&count)
	if err != nil {
		return 0, errors.Wrap(err, "mdbmodels: failed to count content_units_persons rows")
	}
	return count, nil
}
func (q contentUnitsPersonQuery) ExistsP() bool {
	e, err := q.Exists()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return e
}
func (q contentUnitsPersonQuery) Exists() (bool, error) {
	var count int64
	queries.SetCount(q.Query)
	queries.SetLimit(q.Query, 1)
	err := q.Query.QueryRow().Scan(&count)
	if err != nil {
		return false, errors.Wrap(err, "mdbmodels: failed to check if content_units_persons exists")
	}
	return count > 0, nil
}
func (o *ContentUnitsPerson) ContentUnitG(mods ...qm.QueryMod) contentUnitQuery {
	return o.ContentUnit(boil.GetDB(), mods...)
}
func (o *ContentUnitsPerson) ContentUnit(exec boil.Executor, mods ...qm.QueryMod) contentUnitQuery {
	queryMods := []qm.QueryMod{
		qm.Where("id=?", o.ContentUnitID),
	}
	queryMods = append(queryMods, mods...)
	query := ContentUnits(exec, queryMods...)
	queries.SetFrom(query.Query, "\"content_units\"")
	return query
}
func (o *ContentUnitsPerson) PersonG(mods ...qm.QueryMod) personQuery {
	return o.Person(boil.GetDB(), mods...)
}
func (o *ContentUnitsPerson) Person(exec boil.Executor, mods ...qm.QueryMod) personQuery {
	queryMods := []qm.QueryMod{
		qm.Where("id=?", o.PersonID),
	}
	queryMods = append(queryMods, mods...)
	query := Persons(exec, queryMods...)
	queries.SetFrom(query.Query, "\"persons\"")
	return query
}
func (o *ContentUnitsPerson) RoleG(mods ...qm.QueryMod) contentRoleTypeQuery {
	return o.Role(boil.GetDB(), mods...)
}
func (o *ContentUnitsPerson) Role(exec boil.Executor, mods ...qm.QueryMod) contentRoleTypeQuery {
	queryMods := []qm.QueryMod{
		qm.Where("id=?", o.RoleID),
	}
	queryMods = append(queryMods, mods...)
	query := ContentRoleTypes(exec, queryMods...)
	queries.SetFrom(query.Query, "\"content_role_types\"")
	return query
}  
func (contentUnitsPersonL) LoadContentUnit(e boil.Executor, singular bool, maybeContentUnitsPerson interface{}) error {
	var slice []*ContentUnitsPerson
	var object *ContentUnitsPerson
	count := 1
	if singular {
		object = maybeContentUnitsPerson.(*ContentUnitsPerson)
	} else {
		slice = *maybeContentUnitsPerson.(*[]*ContentUnitsPerson)
		count = len(slice)
	}
	args := make([]interface{}, count)
	if singular {
		if object.R == nil {
			object.R = &contentUnitsPersonR{}
		}
		args[0] = object.ContentUnitID
	} else {
		for i, obj := range slice {
			if obj.R == nil {
				obj.R = &contentUnitsPersonR{}
			}
			args[i] = obj.ContentUnitID
		}
	}
	query := fmt.Sprintf(
		"select * from \"content_units\" where \"id\" in (%s)",
		strmangle.Placeholders(dialect.IndexPlaceholders, count, 1, 1),
	)
	if boil.DebugMode {
		fmt.Fprintf(boil.DebugWriter, "%s\n%v\n", query, args)
	}
	results, err := e.Query(query, args...)
	if err != nil {
		return errors.Wrap(err, "failed to eager load ContentUnit")
	}
	defer results.Close()
	var resultSlice []*ContentUnit
	if err = queries.Bind(results, &resultSlice); err != nil {
		return errors.Wrap(err, "failed to bind eager loaded slice ContentUnit")
	}
	if len(resultSlice) == 0 {
		return nil
	}
	if singular {
		object.R.ContentUnit = resultSlice[0]
		return nil
	}
	for _, local := range slice {
		for _, foreign := range resultSlice {
			if local.ContentUnitID == foreign.ID {
				local.R.ContentUnit = foreign
				break
			}
		}
	}
	return nil
}