We need the org ID so that we can avoid bleedover between different organizations.
1656 lines
52 KiB
Go
1656 lines
52 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"
|
|
"time"
|
|
|
|
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 HistoryTreatmentareaMod interface {
|
|
Apply(context.Context, *HistoryTreatmentareaTemplate)
|
|
}
|
|
|
|
type HistoryTreatmentareaModFunc func(context.Context, *HistoryTreatmentareaTemplate)
|
|
|
|
func (f HistoryTreatmentareaModFunc) Apply(ctx context.Context, n *HistoryTreatmentareaTemplate) {
|
|
f(ctx, n)
|
|
}
|
|
|
|
type HistoryTreatmentareaModSlice []HistoryTreatmentareaMod
|
|
|
|
func (mods HistoryTreatmentareaModSlice) Apply(ctx context.Context, n *HistoryTreatmentareaTemplate) {
|
|
for _, f := range mods {
|
|
f.Apply(ctx, n)
|
|
}
|
|
}
|
|
|
|
// HistoryTreatmentareaTemplate is an object representing the database table.
|
|
// all columns are optional and should be set by mods
|
|
type HistoryTreatmentareaTemplate struct {
|
|
OrganizationID func() 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]
|
|
Globalid func() null.Val[string]
|
|
Notified func() null.Val[int16]
|
|
Objectid func() int32
|
|
SessionID func() null.Val[string]
|
|
ShapeArea func() null.Val[float64]
|
|
ShapeLength func() null.Val[float64]
|
|
Treatdate func() null.Val[int64]
|
|
TreatID func() null.Val[string]
|
|
Type func() null.Val[string]
|
|
Created func() null.Val[time.Time]
|
|
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 historyTreatmentareaR
|
|
f *Factory
|
|
|
|
alreadyPersisted bool
|
|
}
|
|
|
|
type historyTreatmentareaR struct {
|
|
Organization *historyTreatmentareaROrganizationR
|
|
}
|
|
|
|
type historyTreatmentareaROrganizationR struct {
|
|
o *OrganizationTemplate
|
|
}
|
|
|
|
// Apply mods to the HistoryTreatmentareaTemplate
|
|
func (o *HistoryTreatmentareaTemplate) Apply(ctx context.Context, mods ...HistoryTreatmentareaMod) {
|
|
for _, mod := range mods {
|
|
mod.Apply(ctx, o)
|
|
}
|
|
}
|
|
|
|
// setModelRels creates and sets the relationships on *models.HistoryTreatmentarea
|
|
// according to the relationships in the template. Nothing is inserted into the db
|
|
func (t HistoryTreatmentareaTemplate) setModelRels(o *models.HistoryTreatmentarea) {
|
|
if t.r.Organization != nil {
|
|
rel := t.r.Organization.o.Build()
|
|
rel.R.HistoryTreatmentareas = append(rel.R.HistoryTreatmentareas, o)
|
|
o.OrganizationID = rel.ID // h2
|
|
o.R.Organization = rel
|
|
}
|
|
}
|
|
|
|
// BuildSetter returns an *models.HistoryTreatmentareaSetter
|
|
// this does nothing with the relationship templates
|
|
func (o HistoryTreatmentareaTemplate) BuildSetter() *models.HistoryTreatmentareaSetter {
|
|
m := &models.HistoryTreatmentareaSetter{}
|
|
|
|
if o.OrganizationID != nil {
|
|
val := o.OrganizationID()
|
|
m.OrganizationID = omit.From(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.Globalid != nil {
|
|
val := o.Globalid()
|
|
m.Globalid = omitnull.FromNull(val)
|
|
}
|
|
if o.Notified != nil {
|
|
val := o.Notified()
|
|
m.Notified = omitnull.FromNull(val)
|
|
}
|
|
if o.Objectid != nil {
|
|
val := o.Objectid()
|
|
m.Objectid = omit.From(val)
|
|
}
|
|
if o.SessionID != nil {
|
|
val := o.SessionID()
|
|
m.SessionID = omitnull.FromNull(val)
|
|
}
|
|
if o.ShapeArea != nil {
|
|
val := o.ShapeArea()
|
|
m.ShapeArea = omitnull.FromNull(val)
|
|
}
|
|
if o.ShapeLength != nil {
|
|
val := o.ShapeLength()
|
|
m.ShapeLength = omitnull.FromNull(val)
|
|
}
|
|
if o.Treatdate != nil {
|
|
val := o.Treatdate()
|
|
m.Treatdate = omitnull.FromNull(val)
|
|
}
|
|
if o.TreatID != nil {
|
|
val := o.TreatID()
|
|
m.TreatID = omitnull.FromNull(val)
|
|
}
|
|
if o.Type != nil {
|
|
val := o.Type()
|
|
m.Type = omitnull.FromNull(val)
|
|
}
|
|
if o.Created != nil {
|
|
val := o.Created()
|
|
m.Created = 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.HistoryTreatmentareaSetter
|
|
// this does nothing with the relationship templates
|
|
func (o HistoryTreatmentareaTemplate) BuildManySetter(number int) []*models.HistoryTreatmentareaSetter {
|
|
m := make([]*models.HistoryTreatmentareaSetter, number)
|
|
|
|
for i := range m {
|
|
m[i] = o.BuildSetter()
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
// Build returns an *models.HistoryTreatmentarea
|
|
// Related objects are also created and placed in the .R field
|
|
// NOTE: Objects are not inserted into the database. Use HistoryTreatmentareaTemplate.Create
|
|
func (o HistoryTreatmentareaTemplate) Build() *models.HistoryTreatmentarea {
|
|
m := &models.HistoryTreatmentarea{}
|
|
|
|
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.Globalid != nil {
|
|
m.Globalid = o.Globalid()
|
|
}
|
|
if o.Notified != nil {
|
|
m.Notified = o.Notified()
|
|
}
|
|
if o.Objectid != nil {
|
|
m.Objectid = o.Objectid()
|
|
}
|
|
if o.SessionID != nil {
|
|
m.SessionID = o.SessionID()
|
|
}
|
|
if o.ShapeArea != nil {
|
|
m.ShapeArea = o.ShapeArea()
|
|
}
|
|
if o.ShapeLength != nil {
|
|
m.ShapeLength = o.ShapeLength()
|
|
}
|
|
if o.Treatdate != nil {
|
|
m.Treatdate = o.Treatdate()
|
|
}
|
|
if o.TreatID != nil {
|
|
m.TreatID = o.TreatID()
|
|
}
|
|
if o.Type != nil {
|
|
m.Type = o.Type()
|
|
}
|
|
if o.Created != nil {
|
|
m.Created = o.Created()
|
|
}
|
|
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.HistoryTreatmentareaSlice
|
|
// Related objects are also created and placed in the .R field
|
|
// NOTE: Objects are not inserted into the database. Use HistoryTreatmentareaTemplate.CreateMany
|
|
func (o HistoryTreatmentareaTemplate) BuildMany(number int) models.HistoryTreatmentareaSlice {
|
|
m := make(models.HistoryTreatmentareaSlice, number)
|
|
|
|
for i := range m {
|
|
m[i] = o.Build()
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
func ensureCreatableHistoryTreatmentarea(m *models.HistoryTreatmentareaSetter) {
|
|
if !(m.OrganizationID.IsValue()) {
|
|
val := random_int32(nil)
|
|
m.OrganizationID = omit.From(val)
|
|
}
|
|
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.HistoryTreatmentarea
|
|
// according to the relationships in the template.
|
|
// any required relationship should have already exist on the model
|
|
func (o *HistoryTreatmentareaTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.HistoryTreatmentarea) error {
|
|
var err error
|
|
|
|
return err
|
|
}
|
|
|
|
// Create builds a historyTreatmentarea and inserts it into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
func (o *HistoryTreatmentareaTemplate) Create(ctx context.Context, exec bob.Executor) (*models.HistoryTreatmentarea, error) {
|
|
var err error
|
|
opt := o.BuildSetter()
|
|
ensureCreatableHistoryTreatmentarea(opt)
|
|
|
|
if o.r.Organization == nil {
|
|
HistoryTreatmentareaMods.WithNewOrganization().Apply(ctx, o)
|
|
}
|
|
|
|
var rel0 *models.Organization
|
|
|
|
if o.r.Organization.o.alreadyPersisted {
|
|
rel0 = o.r.Organization.o.Build()
|
|
} else {
|
|
rel0, err = o.r.Organization.o.Create(ctx, exec)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
|
|
opt.OrganizationID = omit.From(rel0.ID)
|
|
|
|
m, err := models.HistoryTreatmentareas.Insert(opt).One(ctx, exec)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
m.R.Organization = rel0
|
|
|
|
if err := o.insertOptRels(ctx, exec, m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, err
|
|
}
|
|
|
|
// MustCreate builds a historyTreatmentarea and inserts it into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// panics if an error occurs
|
|
func (o *HistoryTreatmentareaTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.HistoryTreatmentarea {
|
|
m, err := o.Create(ctx, exec)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateOrFail builds a historyTreatmentarea 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 *HistoryTreatmentareaTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.HistoryTreatmentarea {
|
|
tb.Helper()
|
|
m, err := o.Create(ctx, exec)
|
|
if err != nil {
|
|
tb.Fatal(err)
|
|
return nil
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateMany builds multiple historyTreatmentareas and inserts them into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
func (o HistoryTreatmentareaTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.HistoryTreatmentareaSlice, error) {
|
|
var err error
|
|
m := make(models.HistoryTreatmentareaSlice, number)
|
|
|
|
for i := range m {
|
|
m[i], err = o.Create(ctx, exec)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
|
|
return m, nil
|
|
}
|
|
|
|
// MustCreateMany builds multiple historyTreatmentareas and inserts them into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// panics if an error occurs
|
|
func (o HistoryTreatmentareaTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.HistoryTreatmentareaSlice {
|
|
m, err := o.CreateMany(ctx, exec, number)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateManyOrFail builds multiple historyTreatmentareas 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 HistoryTreatmentareaTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.HistoryTreatmentareaSlice {
|
|
tb.Helper()
|
|
m, err := o.CreateMany(ctx, exec, number)
|
|
if err != nil {
|
|
tb.Fatal(err)
|
|
return nil
|
|
}
|
|
return m
|
|
}
|
|
|
|
// HistoryTreatmentarea has methods that act as mods for the HistoryTreatmentareaTemplate
|
|
var HistoryTreatmentareaMods historyTreatmentareaMods
|
|
|
|
type historyTreatmentareaMods struct{}
|
|
|
|
func (m historyTreatmentareaMods) RandomizeAllColumns(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModSlice{
|
|
HistoryTreatmentareaMods.RandomOrganizationID(f),
|
|
HistoryTreatmentareaMods.RandomComments(f),
|
|
HistoryTreatmentareaMods.RandomCreationdate(f),
|
|
HistoryTreatmentareaMods.RandomCreator(f),
|
|
HistoryTreatmentareaMods.RandomEditdate(f),
|
|
HistoryTreatmentareaMods.RandomEditor(f),
|
|
HistoryTreatmentareaMods.RandomGlobalid(f),
|
|
HistoryTreatmentareaMods.RandomNotified(f),
|
|
HistoryTreatmentareaMods.RandomObjectid(f),
|
|
HistoryTreatmentareaMods.RandomSessionID(f),
|
|
HistoryTreatmentareaMods.RandomShapeArea(f),
|
|
HistoryTreatmentareaMods.RandomShapeLength(f),
|
|
HistoryTreatmentareaMods.RandomTreatdate(f),
|
|
HistoryTreatmentareaMods.RandomTreatID(f),
|
|
HistoryTreatmentareaMods.RandomType(f),
|
|
HistoryTreatmentareaMods.RandomCreated(f),
|
|
HistoryTreatmentareaMods.RandomCreatedDate(f),
|
|
HistoryTreatmentareaMods.RandomCreatedUser(f),
|
|
HistoryTreatmentareaMods.RandomGeometryX(f),
|
|
HistoryTreatmentareaMods.RandomGeometryY(f),
|
|
HistoryTreatmentareaMods.RandomLastEditedDate(f),
|
|
HistoryTreatmentareaMods.RandomLastEditedUser(f),
|
|
HistoryTreatmentareaMods.RandomVersion(f),
|
|
}
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyTreatmentareaMods) OrganizationID(val int32) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.OrganizationID = func() int32 { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) OrganizationIDFunc(f func() int32) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.OrganizationID = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetOrganizationID() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.OrganizationID = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
func (m historyTreatmentareaMods) RandomOrganizationID(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.OrganizationID = func() int32 {
|
|
return random_int32(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyTreatmentareaMods) Comments(val null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Comments = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) CommentsFunc(f func() null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Comments = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetComments() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomComments(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomCommentsNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) Creationdate(val null.Val[int64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Creationdate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) CreationdateFunc(f func() null.Val[int64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Creationdate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetCreationdate() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomCreationdate(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomCreationdateNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) Creator(val null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Creator = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) CreatorFunc(f func() null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Creator = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetCreator() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomCreator(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomCreatorNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) Editdate(val null.Val[int64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Editdate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) EditdateFunc(f func() null.Val[int64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Editdate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetEditdate() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomEditdate(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomEditdateNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) Editor(val null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Editor = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) EditorFunc(f func() null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Editor = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetEditor() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomEditor(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomEditorNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) Globalid(val null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Globalid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) GlobalidFunc(f func() null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Globalid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetGlobalid() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomGlobalid(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomGlobalidNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) Notified(val null.Val[int16]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Notified = func() null.Val[int16] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) NotifiedFunc(f func() null.Val[int16]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Notified = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetNotified() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Notified = 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 historyTreatmentareaMods) RandomNotified(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Notified = 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 historyTreatmentareaMods) RandomNotifiedNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Notified = 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 historyTreatmentareaMods) Objectid(val int32) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Objectid = func() int32 { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) ObjectidFunc(f func() int32) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Objectid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetObjectid() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomObjectid(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Objectid = func() int32 {
|
|
return random_int32(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyTreatmentareaMods) SessionID(val null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.SessionID = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) SessionIDFunc(f func() null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.SessionID = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetSessionID() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.SessionID = 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 historyTreatmentareaMods) RandomSessionID(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.SessionID = 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 historyTreatmentareaMods) RandomSessionIDNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.SessionID = 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 historyTreatmentareaMods) ShapeArea(val null.Val[float64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.ShapeArea = func() null.Val[float64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) ShapeAreaFunc(f func() null.Val[float64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.ShapeArea = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetShapeArea() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.ShapeArea = 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 historyTreatmentareaMods) RandomShapeArea(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.ShapeArea = 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 historyTreatmentareaMods) RandomShapeAreaNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.ShapeArea = 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 historyTreatmentareaMods) ShapeLength(val null.Val[float64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.ShapeLength = func() null.Val[float64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) ShapeLengthFunc(f func() null.Val[float64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.ShapeLength = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetShapeLength() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.ShapeLength = 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 historyTreatmentareaMods) RandomShapeLength(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.ShapeLength = 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 historyTreatmentareaMods) RandomShapeLengthNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.ShapeLength = 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 historyTreatmentareaMods) Treatdate(val null.Val[int64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Treatdate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) TreatdateFunc(f func() null.Val[int64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Treatdate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetTreatdate() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Treatdate = 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 historyTreatmentareaMods) RandomTreatdate(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Treatdate = 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 historyTreatmentareaMods) RandomTreatdateNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Treatdate = 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 historyTreatmentareaMods) TreatID(val null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.TreatID = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) TreatIDFunc(f func() null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.TreatID = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetTreatID() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.TreatID = 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 historyTreatmentareaMods) RandomTreatID(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.TreatID = 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 historyTreatmentareaMods) RandomTreatIDNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.TreatID = 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 historyTreatmentareaMods) Type(val null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Type = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) TypeFunc(f func() null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Type = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetType() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Type = 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 historyTreatmentareaMods) RandomType(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Type = 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 historyTreatmentareaMods) RandomTypeNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Type = 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 historyTreatmentareaMods) Created(val null.Val[time.Time]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Created = func() null.Val[time.Time] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) CreatedFunc(f func() null.Val[time.Time]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Created = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetCreated() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Created = 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 historyTreatmentareaMods) RandomCreated(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Created = func() null.Val[time.Time] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_time_Time(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 historyTreatmentareaMods) RandomCreatedNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Created = func() null.Val[time.Time] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_time_Time(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyTreatmentareaMods) CreatedDate(val null.Val[int64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.CreatedDate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) CreatedDateFunc(f func() null.Val[int64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.CreatedDate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetCreatedDate() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomCreatedDate(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomCreatedDateNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) CreatedUser(val null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.CreatedUser = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) CreatedUserFunc(f func() null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.CreatedUser = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetCreatedUser() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomCreatedUser(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomCreatedUserNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) GeometryX(val null.Val[float64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.GeometryX = func() null.Val[float64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) GeometryXFunc(f func() null.Val[float64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.GeometryX = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetGeometryX() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomGeometryX(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomGeometryXNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) GeometryY(val null.Val[float64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.GeometryY = func() null.Val[float64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) GeometryYFunc(f func() null.Val[float64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.GeometryY = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetGeometryY() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomGeometryY(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomGeometryYNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) LastEditedDate(val null.Val[int64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.LastEditedDate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) LastEditedDateFunc(f func() null.Val[int64]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.LastEditedDate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetLastEditedDate() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomLastEditedDate(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomLastEditedDateNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) LastEditedUser(val null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.LastEditedUser = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) LastEditedUserFunc(f func() null.Val[string]) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.LastEditedUser = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetLastEditedUser() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomLastEditedUser(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomLastEditedUserNotNull(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) Version(val int32) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Version = func() int32 { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTreatmentareaMods) VersionFunc(f func() int32) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Version = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTreatmentareaMods) UnsetVersion() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
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 historyTreatmentareaMods) RandomVersion(f *faker.Faker) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(_ context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.Version = func() int32 {
|
|
return random_int32(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyTreatmentareaMods) WithParentsCascading() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(ctx context.Context, o *HistoryTreatmentareaTemplate) {
|
|
if isDone, _ := historyTreatmentareaWithParentsCascadingCtx.Value(ctx); isDone {
|
|
return
|
|
}
|
|
ctx = historyTreatmentareaWithParentsCascadingCtx.WithValue(ctx, true)
|
|
{
|
|
|
|
related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading())
|
|
m.WithOrganization(related).Apply(ctx, o)
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyTreatmentareaMods) WithOrganization(rel *OrganizationTemplate) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(ctx context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.r.Organization = &historyTreatmentareaROrganizationR{
|
|
o: rel,
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyTreatmentareaMods) WithNewOrganization(mods ...OrganizationMod) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(ctx context.Context, o *HistoryTreatmentareaTemplate) {
|
|
related := o.f.NewOrganizationWithContext(ctx, mods...)
|
|
|
|
m.WithOrganization(related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m historyTreatmentareaMods) WithExistingOrganization(em *models.Organization) HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(ctx context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.r.Organization = &historyTreatmentareaROrganizationR{
|
|
o: o.f.FromExistingOrganization(em),
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyTreatmentareaMods) WithoutOrganization() HistoryTreatmentareaMod {
|
|
return HistoryTreatmentareaModFunc(func(ctx context.Context, o *HistoryTreatmentareaTemplate) {
|
|
o.r.Organization = nil
|
|
})
|
|
}
|