nidus-sync/factory/history_inspectionsampledetail.bob.go
Eli Ribble 9010726707
Add initial synchronization of Fieldseeker data by oauth
This involves a lot of copy-pasta of code from the previous version of
this logic in another code base. It'll need to be cleaned up, but for
now I need something sooner rather than later.
2025-11-07 08:34:32 +00:00

2045 lines
71 KiB
Go

// Code generated by BobGen psql v0.41.1. DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.
package factory
import (
"context"
"testing"
models "github.com/Gleipnir-Technology/nidus-sync/models"
"github.com/aarondl/opt/null"
"github.com/aarondl/opt/omit"
"github.com/aarondl/opt/omitnull"
"github.com/jaswdr/faker/v2"
"github.com/stephenafamo/bob"
)
type HistoryInspectionsampledetailMod interface {
Apply(context.Context, *HistoryInspectionsampledetailTemplate)
}
type HistoryInspectionsampledetailModFunc func(context.Context, *HistoryInspectionsampledetailTemplate)
func (f HistoryInspectionsampledetailModFunc) Apply(ctx context.Context, n *HistoryInspectionsampledetailTemplate) {
f(ctx, n)
}
type HistoryInspectionsampledetailModSlice []HistoryInspectionsampledetailMod
func (mods HistoryInspectionsampledetailModSlice) Apply(ctx context.Context, n *HistoryInspectionsampledetailTemplate) {
for _, f := range mods {
f.Apply(ctx, n)
}
}
// HistoryInspectionsampledetailTemplate is an object representing the database table.
// all columns are optional and should be set by mods
type HistoryInspectionsampledetailTemplate struct {
OrganizationID func() null.Val[int32]
Comments func() null.Val[string]
Creationdate func() null.Val[int64]
Creator func() null.Val[string]
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Fadultact func() null.Val[string]
Fdomstage func() null.Val[string]
Feggcount func() null.Val[int16]
Fieldspecies func() null.Val[string]
Flarvcount func() null.Val[int16]
Flstages func() null.Val[string]
Fpupcount func() null.Val[int16]
Globalid func() null.Val[string]
InspsampleID func() null.Val[string]
Labspecies func() null.Val[string]
Ldomstage func() null.Val[string]
Leggcount func() null.Val[int16]
Llarvcount func() null.Val[int16]
Lpupcount func() null.Val[int16]
Objectid func() int32
Processed func() null.Val[int16]
CreatedDate func() null.Val[int64]
CreatedUser func() null.Val[string]
GeometryX func() null.Val[float64]
GeometryY func() null.Val[float64]
LastEditedDate func() null.Val[int64]
LastEditedUser func() null.Val[string]
Version func() int32
r historyInspectionsampledetailR
f *Factory
alreadyPersisted bool
}
type historyInspectionsampledetailR struct {
Organization *historyInspectionsampledetailROrganizationR
}
type historyInspectionsampledetailROrganizationR struct {
o *OrganizationTemplate
}
// Apply mods to the HistoryInspectionsampledetailTemplate
func (o *HistoryInspectionsampledetailTemplate) Apply(ctx context.Context, mods ...HistoryInspectionsampledetailMod) {
for _, mod := range mods {
mod.Apply(ctx, o)
}
}
// setModelRels creates and sets the relationships on *models.HistoryInspectionsampledetail
// according to the relationships in the template. Nothing is inserted into the db
func (t HistoryInspectionsampledetailTemplate) setModelRels(o *models.HistoryInspectionsampledetail) {
if t.r.Organization != nil {
rel := t.r.Organization.o.Build()
rel.R.HistoryInspectionsampledetails = append(rel.R.HistoryInspectionsampledetails, o)
o.OrganizationID = null.From(rel.ID) // h2
o.R.Organization = rel
}
}
// BuildSetter returns an *models.HistoryInspectionsampledetailSetter
// this does nothing with the relationship templates
func (o HistoryInspectionsampledetailTemplate) BuildSetter() *models.HistoryInspectionsampledetailSetter {
m := &models.HistoryInspectionsampledetailSetter{}
if o.OrganizationID != nil {
val := o.OrganizationID()
m.OrganizationID = omitnull.FromNull(val)
}
if o.Comments != nil {
val := o.Comments()
m.Comments = omitnull.FromNull(val)
}
if o.Creationdate != nil {
val := o.Creationdate()
m.Creationdate = omitnull.FromNull(val)
}
if o.Creator != nil {
val := o.Creator()
m.Creator = omitnull.FromNull(val)
}
if o.Editdate != nil {
val := o.Editdate()
m.Editdate = omitnull.FromNull(val)
}
if o.Editor != nil {
val := o.Editor()
m.Editor = omitnull.FromNull(val)
}
if o.Fadultact != nil {
val := o.Fadultact()
m.Fadultact = omitnull.FromNull(val)
}
if o.Fdomstage != nil {
val := o.Fdomstage()
m.Fdomstage = omitnull.FromNull(val)
}
if o.Feggcount != nil {
val := o.Feggcount()
m.Feggcount = omitnull.FromNull(val)
}
if o.Fieldspecies != nil {
val := o.Fieldspecies()
m.Fieldspecies = omitnull.FromNull(val)
}
if o.Flarvcount != nil {
val := o.Flarvcount()
m.Flarvcount = omitnull.FromNull(val)
}
if o.Flstages != nil {
val := o.Flstages()
m.Flstages = omitnull.FromNull(val)
}
if o.Fpupcount != nil {
val := o.Fpupcount()
m.Fpupcount = omitnull.FromNull(val)
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
}
if o.InspsampleID != nil {
val := o.InspsampleID()
m.InspsampleID = omitnull.FromNull(val)
}
if o.Labspecies != nil {
val := o.Labspecies()
m.Labspecies = omitnull.FromNull(val)
}
if o.Ldomstage != nil {
val := o.Ldomstage()
m.Ldomstage = omitnull.FromNull(val)
}
if o.Leggcount != nil {
val := o.Leggcount()
m.Leggcount = omitnull.FromNull(val)
}
if o.Llarvcount != nil {
val := o.Llarvcount()
m.Llarvcount = omitnull.FromNull(val)
}
if o.Lpupcount != nil {
val := o.Lpupcount()
m.Lpupcount = omitnull.FromNull(val)
}
if o.Objectid != nil {
val := o.Objectid()
m.Objectid = omit.From(val)
}
if o.Processed != nil {
val := o.Processed()
m.Processed = omitnull.FromNull(val)
}
if o.CreatedDate != nil {
val := o.CreatedDate()
m.CreatedDate = omitnull.FromNull(val)
}
if o.CreatedUser != nil {
val := o.CreatedUser()
m.CreatedUser = omitnull.FromNull(val)
}
if o.GeometryX != nil {
val := o.GeometryX()
m.GeometryX = omitnull.FromNull(val)
}
if o.GeometryY != nil {
val := o.GeometryY()
m.GeometryY = omitnull.FromNull(val)
}
if o.LastEditedDate != nil {
val := o.LastEditedDate()
m.LastEditedDate = omitnull.FromNull(val)
}
if o.LastEditedUser != nil {
val := o.LastEditedUser()
m.LastEditedUser = omitnull.FromNull(val)
}
if o.Version != nil {
val := o.Version()
m.Version = omit.From(val)
}
return m
}
// BuildManySetter returns an []*models.HistoryInspectionsampledetailSetter
// this does nothing with the relationship templates
func (o HistoryInspectionsampledetailTemplate) BuildManySetter(number int) []*models.HistoryInspectionsampledetailSetter {
m := make([]*models.HistoryInspectionsampledetailSetter, number)
for i := range m {
m[i] = o.BuildSetter()
}
return m
}
// Build returns an *models.HistoryInspectionsampledetail
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use HistoryInspectionsampledetailTemplate.Create
func (o HistoryInspectionsampledetailTemplate) Build() *models.HistoryInspectionsampledetail {
m := &models.HistoryInspectionsampledetail{}
if o.OrganizationID != nil {
m.OrganizationID = o.OrganizationID()
}
if o.Comments != nil {
m.Comments = o.Comments()
}
if o.Creationdate != nil {
m.Creationdate = o.Creationdate()
}
if o.Creator != nil {
m.Creator = o.Creator()
}
if o.Editdate != nil {
m.Editdate = o.Editdate()
}
if o.Editor != nil {
m.Editor = o.Editor()
}
if o.Fadultact != nil {
m.Fadultact = o.Fadultact()
}
if o.Fdomstage != nil {
m.Fdomstage = o.Fdomstage()
}
if o.Feggcount != nil {
m.Feggcount = o.Feggcount()
}
if o.Fieldspecies != nil {
m.Fieldspecies = o.Fieldspecies()
}
if o.Flarvcount != nil {
m.Flarvcount = o.Flarvcount()
}
if o.Flstages != nil {
m.Flstages = o.Flstages()
}
if o.Fpupcount != nil {
m.Fpupcount = o.Fpupcount()
}
if o.Globalid != nil {
m.Globalid = o.Globalid()
}
if o.InspsampleID != nil {
m.InspsampleID = o.InspsampleID()
}
if o.Labspecies != nil {
m.Labspecies = o.Labspecies()
}
if o.Ldomstage != nil {
m.Ldomstage = o.Ldomstage()
}
if o.Leggcount != nil {
m.Leggcount = o.Leggcount()
}
if o.Llarvcount != nil {
m.Llarvcount = o.Llarvcount()
}
if o.Lpupcount != nil {
m.Lpupcount = o.Lpupcount()
}
if o.Objectid != nil {
m.Objectid = o.Objectid()
}
if o.Processed != nil {
m.Processed = o.Processed()
}
if o.CreatedDate != nil {
m.CreatedDate = o.CreatedDate()
}
if o.CreatedUser != nil {
m.CreatedUser = o.CreatedUser()
}
if o.GeometryX != nil {
m.GeometryX = o.GeometryX()
}
if o.GeometryY != nil {
m.GeometryY = o.GeometryY()
}
if o.LastEditedDate != nil {
m.LastEditedDate = o.LastEditedDate()
}
if o.LastEditedUser != nil {
m.LastEditedUser = o.LastEditedUser()
}
if o.Version != nil {
m.Version = o.Version()
}
o.setModelRels(m)
return m
}
// BuildMany returns an models.HistoryInspectionsampledetailSlice
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use HistoryInspectionsampledetailTemplate.CreateMany
func (o HistoryInspectionsampledetailTemplate) BuildMany(number int) models.HistoryInspectionsampledetailSlice {
m := make(models.HistoryInspectionsampledetailSlice, number)
for i := range m {
m[i] = o.Build()
}
return m
}
func ensureCreatableHistoryInspectionsampledetail(m *models.HistoryInspectionsampledetailSetter) {
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
}
if !(m.Version.IsValue()) {
val := random_int32(nil)
m.Version = omit.From(val)
}
}
// insertOptRels creates and inserts any optional the relationships on *models.HistoryInspectionsampledetail
// according to the relationships in the template.
// any required relationship should have already exist on the model
func (o *HistoryInspectionsampledetailTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.HistoryInspectionsampledetail) error {
var err error
isOrganizationDone, _ := historyInspectionsampledetailRelOrganizationCtx.Value(ctx)
if !isOrganizationDone && o.r.Organization != nil {
ctx = historyInspectionsampledetailRelOrganizationCtx.WithValue(ctx, true)
if o.r.Organization.o.alreadyPersisted {
m.R.Organization = o.r.Organization.o.Build()
} else {
var rel0 *models.Organization
rel0, err = o.r.Organization.o.Create(ctx, exec)
if err != nil {
return err
}
err = m.AttachOrganization(ctx, exec, rel0)
if err != nil {
return err
}
}
}
return err
}
// Create builds a historyInspectionsampledetail and inserts it into the database
// Relations objects are also inserted and placed in the .R field
func (o *HistoryInspectionsampledetailTemplate) Create(ctx context.Context, exec bob.Executor) (*models.HistoryInspectionsampledetail, error) {
var err error
opt := o.BuildSetter()
ensureCreatableHistoryInspectionsampledetail(opt)
m, err := models.HistoryInspectionsampledetails.Insert(opt).One(ctx, exec)
if err != nil {
return nil, err
}
if err := o.insertOptRels(ctx, exec, m); err != nil {
return nil, err
}
return m, err
}
// MustCreate builds a historyInspectionsampledetail and inserts it into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o *HistoryInspectionsampledetailTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.HistoryInspectionsampledetail {
m, err := o.Create(ctx, exec)
if err != nil {
panic(err)
}
return m
}
// CreateOrFail builds a historyInspectionsampledetail and inserts it into the database
// Relations objects are also inserted and placed in the .R field
// It calls `tb.Fatal(err)` on the test/benchmark if an error occurs
func (o *HistoryInspectionsampledetailTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.HistoryInspectionsampledetail {
tb.Helper()
m, err := o.Create(ctx, exec)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// CreateMany builds multiple historyInspectionsampledetails and inserts them into the database
// Relations objects are also inserted and placed in the .R field
func (o HistoryInspectionsampledetailTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.HistoryInspectionsampledetailSlice, error) {
var err error
m := make(models.HistoryInspectionsampledetailSlice, number)
for i := range m {
m[i], err = o.Create(ctx, exec)
if err != nil {
return nil, err
}
}
return m, nil
}
// MustCreateMany builds multiple historyInspectionsampledetails and inserts them into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o HistoryInspectionsampledetailTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.HistoryInspectionsampledetailSlice {
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
panic(err)
}
return m
}
// CreateManyOrFail builds multiple historyInspectionsampledetails and inserts them into the database
// Relations objects are also inserted and placed in the .R field
// It calls `tb.Fatal(err)` on the test/benchmark if an error occurs
func (o HistoryInspectionsampledetailTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.HistoryInspectionsampledetailSlice {
tb.Helper()
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// HistoryInspectionsampledetail has methods that act as mods for the HistoryInspectionsampledetailTemplate
var HistoryInspectionsampledetailMods historyInspectionsampledetailMods
type historyInspectionsampledetailMods struct{}
func (m historyInspectionsampledetailMods) RandomizeAllColumns(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModSlice{
HistoryInspectionsampledetailMods.RandomOrganizationID(f),
HistoryInspectionsampledetailMods.RandomComments(f),
HistoryInspectionsampledetailMods.RandomCreationdate(f),
HistoryInspectionsampledetailMods.RandomCreator(f),
HistoryInspectionsampledetailMods.RandomEditdate(f),
HistoryInspectionsampledetailMods.RandomEditor(f),
HistoryInspectionsampledetailMods.RandomFadultact(f),
HistoryInspectionsampledetailMods.RandomFdomstage(f),
HistoryInspectionsampledetailMods.RandomFeggcount(f),
HistoryInspectionsampledetailMods.RandomFieldspecies(f),
HistoryInspectionsampledetailMods.RandomFlarvcount(f),
HistoryInspectionsampledetailMods.RandomFlstages(f),
HistoryInspectionsampledetailMods.RandomFpupcount(f),
HistoryInspectionsampledetailMods.RandomGlobalid(f),
HistoryInspectionsampledetailMods.RandomInspsampleID(f),
HistoryInspectionsampledetailMods.RandomLabspecies(f),
HistoryInspectionsampledetailMods.RandomLdomstage(f),
HistoryInspectionsampledetailMods.RandomLeggcount(f),
HistoryInspectionsampledetailMods.RandomLlarvcount(f),
HistoryInspectionsampledetailMods.RandomLpupcount(f),
HistoryInspectionsampledetailMods.RandomObjectid(f),
HistoryInspectionsampledetailMods.RandomProcessed(f),
HistoryInspectionsampledetailMods.RandomCreatedDate(f),
HistoryInspectionsampledetailMods.RandomCreatedUser(f),
HistoryInspectionsampledetailMods.RandomGeometryX(f),
HistoryInspectionsampledetailMods.RandomGeometryY(f),
HistoryInspectionsampledetailMods.RandomLastEditedDate(f),
HistoryInspectionsampledetailMods.RandomLastEditedUser(f),
HistoryInspectionsampledetailMods.RandomVersion(f),
}
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) OrganizationID(val null.Val[int32]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.OrganizationID = func() null.Val[int32] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) OrganizationIDFunc(f func() null.Val[int32]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.OrganizationID = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetOrganizationID() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.OrganizationID = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomOrganizationID(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.OrganizationID = func() null.Val[int32] {
if f == nil {
f = &defaultFaker
}
val := random_int32(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomOrganizationIDNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.OrganizationID = func() null.Val[int32] {
if f == nil {
f = &defaultFaker
}
val := random_int32(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Comments(val null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Comments = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) CommentsFunc(f func() null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Comments = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetComments() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Comments = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomComments(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Comments = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomCommentsNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Comments = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Creationdate(val null.Val[int64]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Creationdate = func() null.Val[int64] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) CreationdateFunc(f func() null.Val[int64]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Creationdate = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetCreationdate() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Creationdate = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomCreationdate(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Creationdate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomCreationdateNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Creationdate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Creator(val null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Creator = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) CreatorFunc(f func() null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Creator = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetCreator() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Creator = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomCreator(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Creator = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomCreatorNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Creator = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Editdate(val null.Val[int64]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Editdate = func() null.Val[int64] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) EditdateFunc(f func() null.Val[int64]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Editdate = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetEditdate() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Editdate = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomEditdate(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Editdate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomEditdateNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Editdate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Editor(val null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Editor = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) EditorFunc(f func() null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Editor = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetEditor() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Editor = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomEditor(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Editor = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomEditorNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Editor = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Fadultact(val null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fadultact = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) FadultactFunc(f func() null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fadultact = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetFadultact() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fadultact = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomFadultact(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fadultact = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomFadultactNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fadultact = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Fdomstage(val null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fdomstage = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) FdomstageFunc(f func() null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fdomstage = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetFdomstage() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fdomstage = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomFdomstage(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fdomstage = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomFdomstageNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fdomstage = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Feggcount(val null.Val[int16]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Feggcount = func() null.Val[int16] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) FeggcountFunc(f func() null.Val[int16]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Feggcount = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetFeggcount() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Feggcount = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomFeggcount(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Feggcount = func() null.Val[int16] {
if f == nil {
f = &defaultFaker
}
val := random_int16(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomFeggcountNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Feggcount = func() null.Val[int16] {
if f == nil {
f = &defaultFaker
}
val := random_int16(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Fieldspecies(val null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fieldspecies = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) FieldspeciesFunc(f func() null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fieldspecies = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetFieldspecies() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fieldspecies = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomFieldspecies(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fieldspecies = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomFieldspeciesNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fieldspecies = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Flarvcount(val null.Val[int16]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Flarvcount = func() null.Val[int16] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) FlarvcountFunc(f func() null.Val[int16]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Flarvcount = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetFlarvcount() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Flarvcount = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomFlarvcount(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Flarvcount = func() null.Val[int16] {
if f == nil {
f = &defaultFaker
}
val := random_int16(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomFlarvcountNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Flarvcount = func() null.Val[int16] {
if f == nil {
f = &defaultFaker
}
val := random_int16(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Flstages(val null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Flstages = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) FlstagesFunc(f func() null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Flstages = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetFlstages() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Flstages = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomFlstages(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Flstages = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomFlstagesNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Flstages = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Fpupcount(val null.Val[int16]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fpupcount = func() null.Val[int16] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) FpupcountFunc(f func() null.Val[int16]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fpupcount = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetFpupcount() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fpupcount = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomFpupcount(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fpupcount = func() null.Val[int16] {
if f == nil {
f = &defaultFaker
}
val := random_int16(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomFpupcountNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Fpupcount = func() null.Val[int16] {
if f == nil {
f = &defaultFaker
}
val := random_int16(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Globalid(val null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Globalid = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) GlobalidFunc(f func() null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Globalid = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetGlobalid() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Globalid = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomGlobalid(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomGlobalidNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) InspsampleID(val null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.InspsampleID = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) InspsampleIDFunc(f func() null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.InspsampleID = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetInspsampleID() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.InspsampleID = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomInspsampleID(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.InspsampleID = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomInspsampleIDNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.InspsampleID = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Labspecies(val null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Labspecies = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) LabspeciesFunc(f func() null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Labspecies = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetLabspecies() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Labspecies = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomLabspecies(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Labspecies = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomLabspeciesNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Labspecies = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Ldomstage(val null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Ldomstage = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) LdomstageFunc(f func() null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Ldomstage = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetLdomstage() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Ldomstage = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomLdomstage(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Ldomstage = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomLdomstageNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Ldomstage = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Leggcount(val null.Val[int16]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Leggcount = func() null.Val[int16] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) LeggcountFunc(f func() null.Val[int16]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Leggcount = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetLeggcount() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Leggcount = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomLeggcount(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Leggcount = func() null.Val[int16] {
if f == nil {
f = &defaultFaker
}
val := random_int16(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomLeggcountNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Leggcount = func() null.Val[int16] {
if f == nil {
f = &defaultFaker
}
val := random_int16(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Llarvcount(val null.Val[int16]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Llarvcount = func() null.Val[int16] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) LlarvcountFunc(f func() null.Val[int16]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Llarvcount = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetLlarvcount() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Llarvcount = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomLlarvcount(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Llarvcount = func() null.Val[int16] {
if f == nil {
f = &defaultFaker
}
val := random_int16(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomLlarvcountNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Llarvcount = func() null.Val[int16] {
if f == nil {
f = &defaultFaker
}
val := random_int16(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Lpupcount(val null.Val[int16]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Lpupcount = func() null.Val[int16] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) LpupcountFunc(f func() null.Val[int16]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Lpupcount = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetLpupcount() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Lpupcount = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomLpupcount(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Lpupcount = func() null.Val[int16] {
if f == nil {
f = &defaultFaker
}
val := random_int16(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomLpupcountNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Lpupcount = func() null.Val[int16] {
if f == nil {
f = &defaultFaker
}
val := random_int16(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Objectid(val int32) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Objectid = func() int32 { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) ObjectidFunc(f func() int32) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Objectid = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetObjectid() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Objectid = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m historyInspectionsampledetailMods) RandomObjectid(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Objectid = func() int32 {
return random_int32(f)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Processed(val null.Val[int16]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Processed = func() null.Val[int16] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) ProcessedFunc(f func() null.Val[int16]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Processed = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetProcessed() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Processed = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomProcessed(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Processed = func() null.Val[int16] {
if f == nil {
f = &defaultFaker
}
val := random_int16(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomProcessedNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Processed = func() null.Val[int16] {
if f == nil {
f = &defaultFaker
}
val := random_int16(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) CreatedDate(val null.Val[int64]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.CreatedDate = func() null.Val[int64] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) CreatedDateFunc(f func() null.Val[int64]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.CreatedDate = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetCreatedDate() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.CreatedDate = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomCreatedDate(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.CreatedDate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomCreatedDateNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.CreatedDate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) CreatedUser(val null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.CreatedUser = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) CreatedUserFunc(f func() null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.CreatedUser = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetCreatedUser() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.CreatedUser = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomCreatedUser(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.CreatedUser = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomCreatedUserNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.CreatedUser = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) GeometryX(val null.Val[float64]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.GeometryX = func() null.Val[float64] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) GeometryXFunc(f func() null.Val[float64]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.GeometryX = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetGeometryX() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.GeometryX = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomGeometryX(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.GeometryX = func() null.Val[float64] {
if f == nil {
f = &defaultFaker
}
val := random_float64(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomGeometryXNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.GeometryX = func() null.Val[float64] {
if f == nil {
f = &defaultFaker
}
val := random_float64(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) GeometryY(val null.Val[float64]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.GeometryY = func() null.Val[float64] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) GeometryYFunc(f func() null.Val[float64]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.GeometryY = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetGeometryY() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.GeometryY = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomGeometryY(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.GeometryY = func() null.Val[float64] {
if f == nil {
f = &defaultFaker
}
val := random_float64(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomGeometryYNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.GeometryY = func() null.Val[float64] {
if f == nil {
f = &defaultFaker
}
val := random_float64(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) LastEditedDate(val null.Val[int64]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.LastEditedDate = func() null.Val[int64] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) LastEditedDateFunc(f func() null.Val[int64]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.LastEditedDate = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetLastEditedDate() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.LastEditedDate = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomLastEditedDate(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.LastEditedDate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomLastEditedDateNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.LastEditedDate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) LastEditedUser(val null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.LastEditedUser = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) LastEditedUserFunc(f func() null.Val[string]) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.LastEditedUser = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetLastEditedUser() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.LastEditedUser = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m historyInspectionsampledetailMods) RandomLastEditedUser(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.LastEditedUser = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m historyInspectionsampledetailMods) RandomLastEditedUserNotNull(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.LastEditedUser = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyInspectionsampledetailMods) Version(val int32) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Version = func() int32 { return val }
})
}
// Set the Column from the function
func (m historyInspectionsampledetailMods) VersionFunc(f func() int32) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Version = f
})
}
// Clear any values for the column
func (m historyInspectionsampledetailMods) UnsetVersion() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Version = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m historyInspectionsampledetailMods) RandomVersion(f *faker.Faker) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(_ context.Context, o *HistoryInspectionsampledetailTemplate) {
o.Version = func() int32 {
return random_int32(f)
}
})
}
func (m historyInspectionsampledetailMods) WithParentsCascading() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(ctx context.Context, o *HistoryInspectionsampledetailTemplate) {
if isDone, _ := historyInspectionsampledetailWithParentsCascadingCtx.Value(ctx); isDone {
return
}
ctx = historyInspectionsampledetailWithParentsCascadingCtx.WithValue(ctx, true)
{
related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading())
m.WithOrganization(related).Apply(ctx, o)
}
})
}
func (m historyInspectionsampledetailMods) WithOrganization(rel *OrganizationTemplate) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(ctx context.Context, o *HistoryInspectionsampledetailTemplate) {
o.r.Organization = &historyInspectionsampledetailROrganizationR{
o: rel,
}
})
}
func (m historyInspectionsampledetailMods) WithNewOrganization(mods ...OrganizationMod) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(ctx context.Context, o *HistoryInspectionsampledetailTemplate) {
related := o.f.NewOrganizationWithContext(ctx, mods...)
m.WithOrganization(related).Apply(ctx, o)
})
}
func (m historyInspectionsampledetailMods) WithExistingOrganization(em *models.Organization) HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(ctx context.Context, o *HistoryInspectionsampledetailTemplate) {
o.r.Organization = &historyInspectionsampledetailROrganizationR{
o: o.f.FromExistingOrganization(em),
}
})
}
func (m historyInspectionsampledetailMods) WithoutOrganization() HistoryInspectionsampledetailMod {
return HistoryInspectionsampledetailModFunc(func(ctx context.Context, o *HistoryInspectionsampledetailTemplate) {
o.r.Organization = nil
})
}