nidus-sync/db/factory/fieldseeker.treatmentarea.bob.go
Eli Ribble 1aefca2f5d Make GlobalID required for all Fieldseeker tables
I'm pretty sure it has to be there, and it allows me to clean up my
code.
2026-01-05 02:28:28 +00:00

1553 lines
51 KiB
Go

// Code generated by BobGen psql v0.0.4-0.20260105020634-53e08d840e47+dirty. DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.
package factory
import (
"context"
"encoding/json"
"testing"
"time"
models "github.com/Gleipnir-Technology/nidus-sync/db/models"
"github.com/aarondl/opt/null"
"github.com/aarondl/opt/omit"
"github.com/aarondl/opt/omitnull"
"github.com/google/uuid"
"github.com/jaswdr/faker/v2"
"github.com/stephenafamo/bob"
"github.com/stephenafamo/bob/types"
)
type FieldseekerTreatmentareaMod interface {
Apply(context.Context, *FieldseekerTreatmentareaTemplate)
}
type FieldseekerTreatmentareaModFunc func(context.Context, *FieldseekerTreatmentareaTemplate)
func (f FieldseekerTreatmentareaModFunc) Apply(ctx context.Context, n *FieldseekerTreatmentareaTemplate) {
f(ctx, n)
}
type FieldseekerTreatmentareaModSlice []FieldseekerTreatmentareaMod
func (mods FieldseekerTreatmentareaModSlice) Apply(ctx context.Context, n *FieldseekerTreatmentareaTemplate) {
for _, f := range mods {
f.Apply(ctx, n)
}
}
// FieldseekerTreatmentareaTemplate is an object representing the database table.
// all columns are optional and should be set by mods
type FieldseekerTreatmentareaTemplate struct {
Objectid func() int64
TreatID func() null.Val[uuid.UUID]
SessionID func() null.Val[uuid.UUID]
Treatdate func() null.Val[time.Time]
Comments func() null.Val[string]
Globalid func() uuid.UUID
CreatedUser func() null.Val[string]
CreatedDate func() null.Val[time.Time]
LastEditedUser func() null.Val[string]
LastEditedDate func() null.Val[time.Time]
Notified func() null.Val[int16]
Type func() null.Val[string]
Creationdate func() null.Val[time.Time]
Creator func() null.Val[string]
Editdate func() null.Val[time.Time]
Editor func() null.Val[string]
ShapeArea func() null.Val[float64]
ShapeLength func() null.Val[float64]
Geometry func() types.JSON[json.RawMessage]
Geospatial func() null.Val[string]
Version func() int32
OrganizationID func() int32
r fieldseekerTreatmentareaR
f *Factory
alreadyPersisted bool
}
type fieldseekerTreatmentareaR struct {
Organization *fieldseekerTreatmentareaROrganizationR
}
type fieldseekerTreatmentareaROrganizationR struct {
o *OrganizationTemplate
}
// Apply mods to the FieldseekerTreatmentareaTemplate
func (o *FieldseekerTreatmentareaTemplate) Apply(ctx context.Context, mods ...FieldseekerTreatmentareaMod) {
for _, mod := range mods {
mod.Apply(ctx, o)
}
}
// setModelRels creates and sets the relationships on *models.FieldseekerTreatmentarea
// according to the relationships in the template. Nothing is inserted into the db
func (t FieldseekerTreatmentareaTemplate) setModelRels(o *models.FieldseekerTreatmentarea) {
if t.r.Organization != nil {
rel := t.r.Organization.o.Build()
rel.R.Treatmentareas = append(rel.R.Treatmentareas, o)
o.OrganizationID = rel.ID // h2
o.R.Organization = rel
}
}
// BuildSetter returns an *models.FieldseekerTreatmentareaSetter
// this does nothing with the relationship templates
func (o FieldseekerTreatmentareaTemplate) BuildSetter() *models.FieldseekerTreatmentareaSetter {
m := &models.FieldseekerTreatmentareaSetter{}
if o.Objectid != nil {
val := o.Objectid()
m.Objectid = omit.From(val)
}
if o.TreatID != nil {
val := o.TreatID()
m.TreatID = omitnull.FromNull(val)
}
if o.SessionID != nil {
val := o.SessionID()
m.SessionID = omitnull.FromNull(val)
}
if o.Treatdate != nil {
val := o.Treatdate()
m.Treatdate = omitnull.FromNull(val)
}
if o.Comments != nil {
val := o.Comments()
m.Comments = omitnull.FromNull(val)
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omit.From(val)
}
if o.CreatedUser != nil {
val := o.CreatedUser()
m.CreatedUser = omitnull.FromNull(val)
}
if o.CreatedDate != nil {
val := o.CreatedDate()
m.CreatedDate = omitnull.FromNull(val)
}
if o.LastEditedUser != nil {
val := o.LastEditedUser()
m.LastEditedUser = omitnull.FromNull(val)
}
if o.LastEditedDate != nil {
val := o.LastEditedDate()
m.LastEditedDate = omitnull.FromNull(val)
}
if o.Notified != nil {
val := o.Notified()
m.Notified = omitnull.FromNull(val)
}
if o.Type != nil {
val := o.Type()
m.Type = 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.ShapeArea != nil {
val := o.ShapeArea()
m.ShapeArea = omitnull.FromNull(val)
}
if o.ShapeLength != nil {
val := o.ShapeLength()
m.ShapeLength = omitnull.FromNull(val)
}
if o.Geometry != nil {
val := o.Geometry()
m.Geometry = omit.From(val)
}
if o.Geospatial != nil {
val := o.Geospatial()
m.Geospatial = omitnull.FromNull(val)
}
if o.Version != nil {
val := o.Version()
m.Version = omit.From(val)
}
if o.OrganizationID != nil {
val := o.OrganizationID()
m.OrganizationID = omit.From(val)
}
return m
}
// BuildManySetter returns an []*models.FieldseekerTreatmentareaSetter
// this does nothing with the relationship templates
func (o FieldseekerTreatmentareaTemplate) BuildManySetter(number int) []*models.FieldseekerTreatmentareaSetter {
m := make([]*models.FieldseekerTreatmentareaSetter, number)
for i := range m {
m[i] = o.BuildSetter()
}
return m
}
// Build returns an *models.FieldseekerTreatmentarea
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use FieldseekerTreatmentareaTemplate.Create
func (o FieldseekerTreatmentareaTemplate) Build() *models.FieldseekerTreatmentarea {
m := &models.FieldseekerTreatmentarea{}
if o.Objectid != nil {
m.Objectid = o.Objectid()
}
if o.TreatID != nil {
m.TreatID = o.TreatID()
}
if o.SessionID != nil {
m.SessionID = o.SessionID()
}
if o.Treatdate != nil {
m.Treatdate = o.Treatdate()
}
if o.Comments != nil {
m.Comments = o.Comments()
}
if o.Globalid != nil {
m.Globalid = o.Globalid()
}
if o.CreatedUser != nil {
m.CreatedUser = o.CreatedUser()
}
if o.CreatedDate != nil {
m.CreatedDate = o.CreatedDate()
}
if o.LastEditedUser != nil {
m.LastEditedUser = o.LastEditedUser()
}
if o.LastEditedDate != nil {
m.LastEditedDate = o.LastEditedDate()
}
if o.Notified != nil {
m.Notified = o.Notified()
}
if o.Type != nil {
m.Type = o.Type()
}
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.ShapeArea != nil {
m.ShapeArea = o.ShapeArea()
}
if o.ShapeLength != nil {
m.ShapeLength = o.ShapeLength()
}
if o.Geometry != nil {
m.Geometry = o.Geometry()
}
if o.Geospatial != nil {
m.Geospatial = o.Geospatial()
}
if o.Version != nil {
m.Version = o.Version()
}
if o.OrganizationID != nil {
m.OrganizationID = o.OrganizationID()
}
o.setModelRels(m)
return m
}
// BuildMany returns an models.FieldseekerTreatmentareaSlice
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use FieldseekerTreatmentareaTemplate.CreateMany
func (o FieldseekerTreatmentareaTemplate) BuildMany(number int) models.FieldseekerTreatmentareaSlice {
m := make(models.FieldseekerTreatmentareaSlice, number)
for i := range m {
m[i] = o.Build()
}
return m
}
func ensureCreatableFieldseekerTreatmentarea(m *models.FieldseekerTreatmentareaSetter) {
if !(m.Globalid.IsValue()) {
val := random_uuid_UUID(nil)
m.Globalid = omit.From(val)
}
if !(m.Geometry.IsValue()) {
val := random_types_JSON_json_RawMessage_(nil)
m.Geometry = omit.From(val)
}
if !(m.OrganizationID.IsValue()) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
}
// insertOptRels creates and inserts any optional the relationships on *models.FieldseekerTreatmentarea
// according to the relationships in the template.
// any required relationship should have already exist on the model
func (o *FieldseekerTreatmentareaTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.FieldseekerTreatmentarea) error {
var err error
return err
}
// Create builds a fieldseekerTreatmentarea and inserts it into the database
// Relations objects are also inserted and placed in the .R field
func (o *FieldseekerTreatmentareaTemplate) Create(ctx context.Context, exec bob.Executor) (*models.FieldseekerTreatmentarea, error) {
var err error
opt := o.BuildSetter()
ensureCreatableFieldseekerTreatmentarea(opt)
if o.r.Organization == nil {
FieldseekerTreatmentareaMods.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.FieldseekerTreatmentareas.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 fieldseekerTreatmentarea and inserts it into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o *FieldseekerTreatmentareaTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.FieldseekerTreatmentarea {
m, err := o.Create(ctx, exec)
if err != nil {
panic(err)
}
return m
}
// CreateOrFail builds a fieldseekerTreatmentarea 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 *FieldseekerTreatmentareaTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.FieldseekerTreatmentarea {
tb.Helper()
m, err := o.Create(ctx, exec)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// CreateMany builds multiple fieldseekerTreatmentareas and inserts them into the database
// Relations objects are also inserted and placed in the .R field
func (o FieldseekerTreatmentareaTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.FieldseekerTreatmentareaSlice, error) {
var err error
m := make(models.FieldseekerTreatmentareaSlice, number)
for i := range m {
m[i], err = o.Create(ctx, exec)
if err != nil {
return nil, err
}
}
return m, nil
}
// MustCreateMany builds multiple fieldseekerTreatmentareas and inserts them into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o FieldseekerTreatmentareaTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.FieldseekerTreatmentareaSlice {
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
panic(err)
}
return m
}
// CreateManyOrFail builds multiple fieldseekerTreatmentareas 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 FieldseekerTreatmentareaTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.FieldseekerTreatmentareaSlice {
tb.Helper()
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// FieldseekerTreatmentarea has methods that act as mods for the FieldseekerTreatmentareaTemplate
var FieldseekerTreatmentareaMods fieldseekerTreatmentareaMods
type fieldseekerTreatmentareaMods struct{}
func (m fieldseekerTreatmentareaMods) RandomizeAllColumns(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModSlice{
FieldseekerTreatmentareaMods.RandomObjectid(f),
FieldseekerTreatmentareaMods.RandomTreatID(f),
FieldseekerTreatmentareaMods.RandomSessionID(f),
FieldseekerTreatmentareaMods.RandomTreatdate(f),
FieldseekerTreatmentareaMods.RandomComments(f),
FieldseekerTreatmentareaMods.RandomGlobalid(f),
FieldseekerTreatmentareaMods.RandomCreatedUser(f),
FieldseekerTreatmentareaMods.RandomCreatedDate(f),
FieldseekerTreatmentareaMods.RandomLastEditedUser(f),
FieldseekerTreatmentareaMods.RandomLastEditedDate(f),
FieldseekerTreatmentareaMods.RandomNotified(f),
FieldseekerTreatmentareaMods.RandomType(f),
FieldseekerTreatmentareaMods.RandomCreationdate(f),
FieldseekerTreatmentareaMods.RandomCreator(f),
FieldseekerTreatmentareaMods.RandomEditdate(f),
FieldseekerTreatmentareaMods.RandomEditor(f),
FieldseekerTreatmentareaMods.RandomShapeArea(f),
FieldseekerTreatmentareaMods.RandomShapeLength(f),
FieldseekerTreatmentareaMods.RandomGeometry(f),
FieldseekerTreatmentareaMods.RandomGeospatial(f),
FieldseekerTreatmentareaMods.RandomVersion(f),
FieldseekerTreatmentareaMods.RandomOrganizationID(f),
}
}
// Set the model columns to this value
func (m fieldseekerTreatmentareaMods) Objectid(val int64) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Objectid = func() int64 { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) ObjectidFunc(f func() int64) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Objectid = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetObjectid() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomObjectid(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Objectid = func() int64 {
return random_int64(f)
}
})
}
// Set the model columns to this value
func (m fieldseekerTreatmentareaMods) TreatID(val null.Val[uuid.UUID]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.TreatID = func() null.Val[uuid.UUID] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) TreatIDFunc(f func() null.Val[uuid.UUID]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.TreatID = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetTreatID() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomTreatID(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.TreatID = func() null.Val[uuid.UUID] {
if f == nil {
f = &defaultFaker
}
val := random_uuid_UUID(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 fieldseekerTreatmentareaMods) RandomTreatIDNotNull(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.TreatID = func() null.Val[uuid.UUID] {
if f == nil {
f = &defaultFaker
}
val := random_uuid_UUID(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerTreatmentareaMods) SessionID(val null.Val[uuid.UUID]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.SessionID = func() null.Val[uuid.UUID] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) SessionIDFunc(f func() null.Val[uuid.UUID]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.SessionID = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetSessionID() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomSessionID(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.SessionID = func() null.Val[uuid.UUID] {
if f == nil {
f = &defaultFaker
}
val := random_uuid_UUID(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 fieldseekerTreatmentareaMods) RandomSessionIDNotNull(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.SessionID = func() null.Val[uuid.UUID] {
if f == nil {
f = &defaultFaker
}
val := random_uuid_UUID(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerTreatmentareaMods) Treatdate(val null.Val[time.Time]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Treatdate = func() null.Val[time.Time] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) TreatdateFunc(f func() null.Val[time.Time]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Treatdate = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetTreatdate() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomTreatdate(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Treatdate = 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 fieldseekerTreatmentareaMods) RandomTreatdateNotNull(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Treatdate = 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 fieldseekerTreatmentareaMods) Comments(val null.Val[string]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Comments = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) CommentsFunc(f func() null.Val[string]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Comments = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetComments() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomComments(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Comments = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "250")
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 fieldseekerTreatmentareaMods) RandomCommentsNotNull(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Comments = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "250")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerTreatmentareaMods) Globalid(val uuid.UUID) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Globalid = func() uuid.UUID { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) GlobalidFunc(f func() uuid.UUID) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Globalid = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetGlobalid() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Globalid = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fieldseekerTreatmentareaMods) RandomGlobalid(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Globalid = func() uuid.UUID {
return random_uuid_UUID(f)
}
})
}
// Set the model columns to this value
func (m fieldseekerTreatmentareaMods) CreatedUser(val null.Val[string]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.CreatedUser = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) CreatedUserFunc(f func() null.Val[string]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.CreatedUser = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetCreatedUser() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomCreatedUser(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.CreatedUser = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "255")
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 fieldseekerTreatmentareaMods) RandomCreatedUserNotNull(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.CreatedUser = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "255")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerTreatmentareaMods) CreatedDate(val null.Val[time.Time]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.CreatedDate = func() null.Val[time.Time] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) CreatedDateFunc(f func() null.Val[time.Time]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.CreatedDate = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetCreatedDate() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomCreatedDate(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.CreatedDate = 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 fieldseekerTreatmentareaMods) RandomCreatedDateNotNull(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.CreatedDate = 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 fieldseekerTreatmentareaMods) LastEditedUser(val null.Val[string]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.LastEditedUser = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) LastEditedUserFunc(f func() null.Val[string]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.LastEditedUser = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetLastEditedUser() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomLastEditedUser(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.LastEditedUser = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "255")
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 fieldseekerTreatmentareaMods) RandomLastEditedUserNotNull(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.LastEditedUser = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "255")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerTreatmentareaMods) LastEditedDate(val null.Val[time.Time]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.LastEditedDate = func() null.Val[time.Time] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) LastEditedDateFunc(f func() null.Val[time.Time]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.LastEditedDate = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetLastEditedDate() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomLastEditedDate(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.LastEditedDate = 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 fieldseekerTreatmentareaMods) RandomLastEditedDateNotNull(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.LastEditedDate = 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 fieldseekerTreatmentareaMods) Notified(val null.Val[int16]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Notified = func() null.Val[int16] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) NotifiedFunc(f func() null.Val[int16]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Notified = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetNotified() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomNotified(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomNotifiedNotNull(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) Type(val null.Val[string]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Type = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) TypeFunc(f func() null.Val[string]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Type = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetType() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomType(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Type = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "25")
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 fieldseekerTreatmentareaMods) RandomTypeNotNull(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Type = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "25")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerTreatmentareaMods) Creationdate(val null.Val[time.Time]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Creationdate = func() null.Val[time.Time] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) CreationdateFunc(f func() null.Val[time.Time]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Creationdate = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetCreationdate() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomCreationdate(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Creationdate = 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 fieldseekerTreatmentareaMods) RandomCreationdateNotNull(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Creationdate = 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 fieldseekerTreatmentareaMods) Creator(val null.Val[string]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Creator = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) CreatorFunc(f func() null.Val[string]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Creator = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetCreator() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomCreator(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Creator = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "128")
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 fieldseekerTreatmentareaMods) RandomCreatorNotNull(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Creator = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "128")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerTreatmentareaMods) Editdate(val null.Val[time.Time]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Editdate = func() null.Val[time.Time] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) EditdateFunc(f func() null.Val[time.Time]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Editdate = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetEditdate() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomEditdate(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Editdate = 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 fieldseekerTreatmentareaMods) RandomEditdateNotNull(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Editdate = 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 fieldseekerTreatmentareaMods) Editor(val null.Val[string]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Editor = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) EditorFunc(f func() null.Val[string]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Editor = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetEditor() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomEditor(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Editor = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "128")
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 fieldseekerTreatmentareaMods) RandomEditorNotNull(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Editor = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "128")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerTreatmentareaMods) ShapeArea(val null.Val[float64]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.ShapeArea = func() null.Val[float64] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) ShapeAreaFunc(f func() null.Val[float64]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.ShapeArea = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetShapeArea() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomShapeArea(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomShapeAreaNotNull(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) ShapeLength(val null.Val[float64]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.ShapeLength = func() null.Val[float64] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) ShapeLengthFunc(f func() null.Val[float64]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.ShapeLength = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetShapeLength() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomShapeLength(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomShapeLengthNotNull(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) Geometry(val types.JSON[json.RawMessage]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Geometry = func() types.JSON[json.RawMessage] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) GeometryFunc(f func() types.JSON[json.RawMessage]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Geometry = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetGeometry() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Geometry = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fieldseekerTreatmentareaMods) RandomGeometry(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Geometry = func() types.JSON[json.RawMessage] {
return random_types_JSON_json_RawMessage_(f)
}
})
}
// Set the model columns to this value
func (m fieldseekerTreatmentareaMods) Geospatial(val null.Val[string]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Geospatial = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) GeospatialFunc(f func() null.Val[string]) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Geospatial = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetGeospatial() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Geospatial = 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 fieldseekerTreatmentareaMods) RandomGeospatial(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Geospatial = 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 fieldseekerTreatmentareaMods) RandomGeospatialNotNull(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Geospatial = 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 fieldseekerTreatmentareaMods) Version(val int32) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Version = func() int32 { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) VersionFunc(f func() int32) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Version = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetVersion() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomVersion(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.Version = func() int32 {
return random_int32(f)
}
})
}
// Set the model columns to this value
func (m fieldseekerTreatmentareaMods) OrganizationID(val int32) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.OrganizationID = func() int32 { return val }
})
}
// Set the Column from the function
func (m fieldseekerTreatmentareaMods) OrganizationIDFunc(f func() int32) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.OrganizationID = f
})
}
// Clear any values for the column
func (m fieldseekerTreatmentareaMods) UnsetOrganizationID() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
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 fieldseekerTreatmentareaMods) RandomOrganizationID(f *faker.Faker) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(_ context.Context, o *FieldseekerTreatmentareaTemplate) {
o.OrganizationID = func() int32 {
return random_int32(f)
}
})
}
func (m fieldseekerTreatmentareaMods) WithParentsCascading() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(ctx context.Context, o *FieldseekerTreatmentareaTemplate) {
if isDone, _ := fieldseekerTreatmentareaWithParentsCascadingCtx.Value(ctx); isDone {
return
}
ctx = fieldseekerTreatmentareaWithParentsCascadingCtx.WithValue(ctx, true)
{
related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading())
m.WithOrganization(related).Apply(ctx, o)
}
})
}
func (m fieldseekerTreatmentareaMods) WithOrganization(rel *OrganizationTemplate) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(ctx context.Context, o *FieldseekerTreatmentareaTemplate) {
o.r.Organization = &fieldseekerTreatmentareaROrganizationR{
o: rel,
}
})
}
func (m fieldseekerTreatmentareaMods) WithNewOrganization(mods ...OrganizationMod) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(ctx context.Context, o *FieldseekerTreatmentareaTemplate) {
related := o.f.NewOrganizationWithContext(ctx, mods...)
m.WithOrganization(related).Apply(ctx, o)
})
}
func (m fieldseekerTreatmentareaMods) WithExistingOrganization(em *models.Organization) FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(ctx context.Context, o *FieldseekerTreatmentareaTemplate) {
o.r.Organization = &fieldseekerTreatmentareaROrganizationR{
o: o.f.FromExistingOrganization(em),
}
})
}
func (m fieldseekerTreatmentareaMods) WithoutOrganization() FieldseekerTreatmentareaMod {
return FieldseekerTreatmentareaModFunc(func(ctx context.Context, o *FieldseekerTreatmentareaTemplate) {
o.r.Organization = nil
})
}