Documentation
¶
Overview ¶
Package model contains the ORM for objects for the goradd database.
Queries use a builder pattern, started with a Query* function. Add functions to the builder to further constrain the query, using nodes from the node package to refer to tables and columns in the database. End the query with either a Load call to get a list of items, a Get call to get one item, or a Count call to count the number of items in the query.
Some Examples
projects := model.QueryProjects().Load()
Returns all the projects in the database.
projects := model.QueryProjects(). Join(node.Project().Manager()). Where(op.GreaterOrEqual(node.Project().StartDate(), time.NewDate(2006, 1, 1)). OrderBy(node.Project().Num()). Load()
Returns the projects that started in 2006 or later, with the manager objects attached, and ordered by project number. To get the manager of the first project returned, you can do this:
firstManager := projects[0].Manager()
See the goradd documentation for more information.
Index ¶
- Constants
- func AllPersonTypesI() (values []any)
- func AllProjectStatusesI() (values []any)
- func CountAddressByCity(ctx context.Context, city string) int
- func CountAddressByID(ctx context.Context, id string) int
- func CountAddressByPersonID(ctx context.Context, personID string) int
- func CountAddressByStreet(ctx context.Context, street string) int
- func CountEmployeeInfoByEmployeeNumber(ctx context.Context, employeeNumber int) int
- func CountEmployeeInfoByID(ctx context.Context, id string) int
- func CountEmployeeInfoByPersonID(ctx context.Context, personID string) int
- func CountGiftByName(ctx context.Context, name string) int
- func CountGiftByNumber(ctx context.Context, number int) int
- func CountLoginByID(ctx context.Context, id string) int
- func CountLoginByIsEnabled(ctx context.Context, isEnabled bool) int
- func CountLoginByPassword(ctx context.Context, password string) int
- func CountLoginByPersonID(ctx context.Context, personID string) int
- func CountLoginByUsername(ctx context.Context, username string) int
- func CountMilestoneByID(ctx context.Context, id string) int
- func CountMilestoneByName(ctx context.Context, name string) int
- func CountMilestoneByProjectID(ctx context.Context, projectID string) int
- func CountPersonByFirstName(ctx context.Context, firstName string) int
- func CountPersonByID(ctx context.Context, id string) int
- func CountPersonByLastName(ctx context.Context, lastName string) int
- func CountPersonWithLockByFirstName(ctx context.Context, firstName string) int
- func CountPersonWithLockByID(ctx context.Context, id string) int
- func CountPersonWithLockByLastName(ctx context.Context, lastName string) int
- func CountPersonWithLockBySysTimestamp(ctx context.Context, sysTimestamp time.Time) int
- func CountProjectByBudget(ctx context.Context, budget string) int
- func CountProjectByDescription(ctx context.Context, description string) int
- func CountProjectByEndDate(ctx context.Context, endDate time.Time) int
- func CountProjectByID(ctx context.Context, id string) int
- func CountProjectByManagerID(ctx context.Context, managerID string) int
- func CountProjectByName(ctx context.Context, name string) int
- func CountProjectByNum(ctx context.Context, num int) int
- func CountProjectBySpent(ctx context.Context, spent string) int
- func CountProjectByStartDate(ctx context.Context, startDate time.Time) int
- func CountProjectByStatusID(ctx context.Context, statusID uint) int
- func Database() db.DatabaseI
- func DeleteAddress(ctx context.Context, pk string)
- func DeleteEmployeeInfo(ctx context.Context, pk string)
- func DeleteGift(ctx context.Context, pk int)
- func DeleteLogin(ctx context.Context, pk string)
- func DeleteMilestone(ctx context.Context, pk string)
- func DeletePerson(ctx context.Context, pk string)
- func DeletePersonWithLock(ctx context.Context, pk string)
- func DeleteProject(ctx context.Context, pk string)
- func HasAddress(ctx context.Context, primaryKey string) bool
- func HasEmployeeInfo(ctx context.Context, primaryKey string) bool
- func HasEmployeeInfoByPersonID(ctx context.Context, personID string) bool
- func HasGift(ctx context.Context, primaryKey int) bool
- func HasLogin(ctx context.Context, primaryKey string) bool
- func HasLoginByPersonID(ctx context.Context, personID interface{}) bool
- func HasLoginByUsername(ctx context.Context, username string) bool
- func HasMilestone(ctx context.Context, primaryKey string) bool
- func HasPerson(ctx context.Context, primaryKey string) bool
- func HasPersonWithLock(ctx context.Context, primaryKey string) bool
- func HasProject(ctx context.Context, primaryKey string) bool
- func HasProjectByNum(ctx context.Context, num int) bool
- func PersonTypeNames() []string
- func ProjectStatusDescriptions() []string
- func ProjectStatusGuidelines() []string
- func ProjectStatusIsActives() []bool
- func ProjectStatusNames() []string
- type Address
- func (o *Address) City() string
- func (o *Address) CityIsNull() bool
- func (o *Address) CityIsValid() bool
- func (o *Address) City_I() interface{}
- func (o *Address) Copy() (newObject *Address)
- func (o *Address) Delete(ctx context.Context)
- func (o *Address) Get(key string) interface{}
- func (o *Address) GetAlias(key string) query.AliasValue
- func (o *Address) ID() string
- func (o *Address) IDIsValid() bool
- func (o *Address) Initialize()
- func (o *Address) IsDirty() (dirty bool)
- func (o *Address) IsNew() bool
- func (o *Address) LoadPerson(ctx context.Context) *Person
- func (o *Address) MarshalBinary() ([]byte, error)
- func (o *Address) MarshalJSON() (data []byte, err error)
- func (o *Address) MarshalStringMap() map[string]interface{}
- func (o *Address) OriginalPrimaryKey() string
- func (o *Address) Person() *Person
- func (o *Address) PersonID() string
- func (o *Address) PersonIDIsValid() bool
- func (o *Address) PrimaryKey() string
- func (o *Address) Save(ctx context.Context)
- func (o *Address) SetCity(i interface{})
- func (o *Address) SetPerson(v *Person)
- func (o *Address) SetPersonID(v string)
- func (o *Address) SetStreet(v string)
- func (o *Address) Street() string
- func (o *Address) StreetIsValid() bool
- func (o *Address) String() string
- func (o *Address) UnmarshalBinary(data []byte) (err error)
- func (o *Address) UnmarshalJSON(data []byte) (err error)
- func (o *Address) UnmarshalStringMap(m map[string]interface{}) (err error)
- type AddressesBuilder
- func (b *AddressesBuilder) Alias(name string, n query.NodeI) *AddressesBuilder
- func (b *AddressesBuilder) Count(distinct bool, nodes ...query.NodeI) uint
- func (b *AddressesBuilder) Delete()
- func (b *AddressesBuilder) Distinct() *AddressesBuilder
- func (b *AddressesBuilder) Expand(n query.NodeI) *AddressesBuilder
- func (b *AddressesBuilder) Get() *Address
- func (b *AddressesBuilder) GroupBy(nodes ...query.NodeI) *AddressesBuilder
- func (b *AddressesBuilder) Having(node query.NodeI) *AddressesBuilder
- func (b *AddressesBuilder) Join(n query.NodeI, conditions ...query.NodeI) *AddressesBuilder
- func (b *AddressesBuilder) Limit(maxRowCount int, offset int) *AddressesBuilder
- func (b *AddressesBuilder) Load() (addressSlice []*Address)
- func (b *AddressesBuilder) LoadCursor() addressCursor
- func (b *AddressesBuilder) LoadI() (addressSlice []interface{})
- func (b *AddressesBuilder) OrderBy(nodes ...query.NodeI) *AddressesBuilder
- func (b *AddressesBuilder) Select(nodes ...query.NodeI) *AddressesBuilder
- func (b *AddressesBuilder) Subquery() *query.SubqueryNode
- func (b *AddressesBuilder) Where(c query.NodeI) *AddressesBuilder
- type EmployeeInfo
- func (o *EmployeeInfo) Copy() (newObject *EmployeeInfo)
- func (o *EmployeeInfo) Delete(ctx context.Context)
- func (o *EmployeeInfo) EmployeeNumber() int
- func (o *EmployeeInfo) EmployeeNumberIsValid() bool
- func (o *EmployeeInfo) Get(key string) interface{}
- func (o *EmployeeInfo) GetAlias(key string) query.AliasValue
- func (o *EmployeeInfo) ID() string
- func (o *EmployeeInfo) IDIsValid() bool
- func (o *EmployeeInfo) Initialize()
- func (o *EmployeeInfo) IsDirty() (dirty bool)
- func (o *EmployeeInfo) IsNew() bool
- func (o *EmployeeInfo) LoadPerson(ctx context.Context) *Person
- func (o *EmployeeInfo) MarshalBinary() ([]byte, error)
- func (o *EmployeeInfo) MarshalJSON() (data []byte, err error)
- func (o *EmployeeInfo) MarshalStringMap() map[string]interface{}
- func (o *EmployeeInfo) OriginalPrimaryKey() string
- func (o *EmployeeInfo) Person() *Person
- func (o *EmployeeInfo) PersonID() string
- func (o *EmployeeInfo) PersonIDIsValid() bool
- func (o *EmployeeInfo) PrimaryKey() string
- func (o *EmployeeInfo) Save(ctx context.Context)
- func (o *EmployeeInfo) SetEmployeeNumber(v int)
- func (o *EmployeeInfo) SetPerson(v *Person)
- func (o *EmployeeInfo) SetPersonID(v string)
- func (o *EmployeeInfo) String() string
- func (o *EmployeeInfo) UnmarshalBinary(data []byte) (err error)
- func (o *EmployeeInfo) UnmarshalJSON(data []byte) (err error)
- func (o *EmployeeInfo) UnmarshalStringMap(m map[string]interface{}) (err error)
- type EmployeeInfosBuilder
- func (b *EmployeeInfosBuilder) Alias(name string, n query.NodeI) *EmployeeInfosBuilder
- func (b *EmployeeInfosBuilder) Count(distinct bool, nodes ...query.NodeI) uint
- func (b *EmployeeInfosBuilder) Delete()
- func (b *EmployeeInfosBuilder) Distinct() *EmployeeInfosBuilder
- func (b *EmployeeInfosBuilder) Expand(n query.NodeI) *EmployeeInfosBuilder
- func (b *EmployeeInfosBuilder) Get() *EmployeeInfo
- func (b *EmployeeInfosBuilder) GroupBy(nodes ...query.NodeI) *EmployeeInfosBuilder
- func (b *EmployeeInfosBuilder) Having(node query.NodeI) *EmployeeInfosBuilder
- func (b *EmployeeInfosBuilder) Join(n query.NodeI, conditions ...query.NodeI) *EmployeeInfosBuilder
- func (b *EmployeeInfosBuilder) Limit(maxRowCount int, offset int) *EmployeeInfosBuilder
- func (b *EmployeeInfosBuilder) Load() (employeeInfoSlice []*EmployeeInfo)
- func (b *EmployeeInfosBuilder) LoadCursor() employeeInfoCursor
- func (b *EmployeeInfosBuilder) LoadI() (employeeInfoSlice []interface{})
- func (b *EmployeeInfosBuilder) OrderBy(nodes ...query.NodeI) *EmployeeInfosBuilder
- func (b *EmployeeInfosBuilder) Select(nodes ...query.NodeI) *EmployeeInfosBuilder
- func (b *EmployeeInfosBuilder) Subquery() *query.SubqueryNode
- func (b *EmployeeInfosBuilder) Where(c query.NodeI) *EmployeeInfosBuilder
- type Gift
- func (o *Gift) Copy() (newObject *Gift)
- func (o *Gift) Delete(ctx context.Context)
- func (o *Gift) Get(key string) interface{}
- func (o *Gift) GetAlias(key string) query.AliasValue
- func (o *Gift) Initialize()
- func (o *Gift) IsDirty() (dirty bool)
- func (o *Gift) IsNew() bool
- func (o *Gift) MarshalBinary() ([]byte, error)
- func (o *Gift) MarshalJSON() (data []byte, err error)
- func (o *Gift) MarshalStringMap() map[string]interface{}
- func (o *Gift) Name() string
- func (o *Gift) NameIsValid() bool
- func (o *Gift) Number() int
- func (o *Gift) NumberIsValid() bool
- func (o *Gift) OriginalPrimaryKey() int
- func (o *Gift) PrimaryKey() int
- func (o *Gift) Save(ctx context.Context)
- func (o *Gift) SetName(v string)
- func (o *Gift) SetNumber(v int)
- func (o *Gift) String() string
- func (o *Gift) UnmarshalBinary(data []byte) (err error)
- func (o *Gift) UnmarshalJSON(data []byte) (err error)
- func (o *Gift) UnmarshalStringMap(m map[string]interface{}) (err error)
- type GiftsBuilder
- func (b *GiftsBuilder) Alias(name string, n query.NodeI) *GiftsBuilder
- func (b *GiftsBuilder) Count(distinct bool, nodes ...query.NodeI) uint
- func (b *GiftsBuilder) Delete()
- func (b *GiftsBuilder) Distinct() *GiftsBuilder
- func (b *GiftsBuilder) Expand(n query.NodeI) *GiftsBuilder
- func (b *GiftsBuilder) Get() *Gift
- func (b *GiftsBuilder) GroupBy(nodes ...query.NodeI) *GiftsBuilder
- func (b *GiftsBuilder) Having(node query.NodeI) *GiftsBuilder
- func (b *GiftsBuilder) Join(n query.NodeI, conditions ...query.NodeI) *GiftsBuilder
- func (b *GiftsBuilder) Limit(maxRowCount int, offset int) *GiftsBuilder
- func (b *GiftsBuilder) Load() (giftSlice []*Gift)
- func (b *GiftsBuilder) LoadCursor() giftCursor
- func (b *GiftsBuilder) LoadI() (giftSlice []interface{})
- func (b *GiftsBuilder) OrderBy(nodes ...query.NodeI) *GiftsBuilder
- func (b *GiftsBuilder) Select(nodes ...query.NodeI) *GiftsBuilder
- func (b *GiftsBuilder) Subquery() *query.SubqueryNode
- func (b *GiftsBuilder) Where(c query.NodeI) *GiftsBuilder
- type Login
- func LoadLogin(ctx context.Context, primaryKey string, joinOrSelectNodes ...query.NodeI) *Login
- func LoadLoginByPersonID(ctx context.Context, personID interface{}, joinOrSelectNodes ...query.NodeI) *Login
- func LoadLoginByUsername(ctx context.Context, username string, joinOrSelectNodes ...query.NodeI) *Login
- func NewLogin() *Login
- func (o *Login) Copy() (newObject *Login)
- func (o *Login) Delete(ctx context.Context)
- func (o *Login) Get(key string) interface{}
- func (o *Login) GetAlias(key string) query.AliasValue
- func (o *Login) ID() string
- func (o *Login) IDIsValid() bool
- func (o *Login) Initialize()
- func (o *Login) IsDirty() (dirty bool)
- func (o *Login) IsEnabled() bool
- func (o *Login) IsEnabledIsValid() bool
- func (o *Login) IsNew() bool
- func (o *Login) LoadPerson(ctx context.Context) *Person
- func (o *Login) MarshalBinary() ([]byte, error)
- func (o *Login) MarshalJSON() (data []byte, err error)
- func (o *Login) MarshalStringMap() map[string]interface{}
- func (o *Login) OriginalPrimaryKey() string
- func (o *Login) Password() string
- func (o *Login) PasswordIsNull() bool
- func (o *Login) PasswordIsValid() bool
- func (o *Login) Password_I() interface{}
- func (o *Login) Person() *Person
- func (o *Login) PersonID() string
- func (o *Login) PersonIDIsNull() bool
- func (o *Login) PersonIDIsValid() bool
- func (o *Login) PersonID_I() interface{}
- func (o *Login) PrimaryKey() string
- func (o *Login) Save(ctx context.Context)
- func (o *Login) SetIsEnabled(v bool)
- func (o *Login) SetPassword(i interface{})
- func (o *Login) SetPerson(v *Person)
- func (o *Login) SetPersonID(i interface{})
- func (o *Login) SetUsername(v string)
- func (o *Login) String() string
- func (o *Login) UnmarshalBinary(data []byte) (err error)
- func (o *Login) UnmarshalJSON(data []byte) (err error)
- func (o *Login) UnmarshalStringMap(m map[string]interface{}) (err error)
- func (o *Login) Username() string
- func (o *Login) UsernameIsValid() bool
- type LoginsBuilder
- func (b *LoginsBuilder) Alias(name string, n query.NodeI) *LoginsBuilder
- func (b *LoginsBuilder) Count(distinct bool, nodes ...query.NodeI) uint
- func (b *LoginsBuilder) Delete()
- func (b *LoginsBuilder) Distinct() *LoginsBuilder
- func (b *LoginsBuilder) Expand(n query.NodeI) *LoginsBuilder
- func (b *LoginsBuilder) Get() *Login
- func (b *LoginsBuilder) GroupBy(nodes ...query.NodeI) *LoginsBuilder
- func (b *LoginsBuilder) Having(node query.NodeI) *LoginsBuilder
- func (b *LoginsBuilder) Join(n query.NodeI, conditions ...query.NodeI) *LoginsBuilder
- func (b *LoginsBuilder) Limit(maxRowCount int, offset int) *LoginsBuilder
- func (b *LoginsBuilder) Load() (loginSlice []*Login)
- func (b *LoginsBuilder) LoadCursor() loginCursor
- func (b *LoginsBuilder) LoadI() (loginSlice []interface{})
- func (b *LoginsBuilder) OrderBy(nodes ...query.NodeI) *LoginsBuilder
- func (b *LoginsBuilder) Select(nodes ...query.NodeI) *LoginsBuilder
- func (b *LoginsBuilder) Subquery() *query.SubqueryNode
- func (b *LoginsBuilder) Where(c query.NodeI) *LoginsBuilder
- type Milestone
- func (o *Milestone) Copy() (newObject *Milestone)
- func (o *Milestone) Delete(ctx context.Context)
- func (o *Milestone) Get(key string) interface{}
- func (o *Milestone) GetAlias(key string) query.AliasValue
- func (o *Milestone) ID() string
- func (o *Milestone) IDIsValid() bool
- func (o *Milestone) Initialize()
- func (o *Milestone) IsDirty() (dirty bool)
- func (o *Milestone) IsNew() bool
- func (o *Milestone) LoadProject(ctx context.Context) *Project
- func (o *Milestone) MarshalBinary() ([]byte, error)
- func (o *Milestone) MarshalJSON() (data []byte, err error)
- func (o *Milestone) MarshalStringMap() map[string]interface{}
- func (o *Milestone) Name() string
- func (o *Milestone) NameIsValid() bool
- func (o *Milestone) OriginalPrimaryKey() string
- func (o *Milestone) PrimaryKey() string
- func (o *Milestone) Project() *Project
- func (o *Milestone) ProjectID() string
- func (o *Milestone) ProjectIDIsValid() bool
- func (o *Milestone) Save(ctx context.Context)
- func (o *Milestone) SetName(v string)
- func (o *Milestone) SetProject(v *Project)
- func (o *Milestone) SetProjectID(v string)
- func (o *Milestone) String() string
- func (o *Milestone) UnmarshalBinary(data []byte) (err error)
- func (o *Milestone) UnmarshalJSON(data []byte) (err error)
- func (o *Milestone) UnmarshalStringMap(m map[string]interface{}) (err error)
- type MilestonesBuilder
- func (b *MilestonesBuilder) Alias(name string, n query.NodeI) *MilestonesBuilder
- func (b *MilestonesBuilder) Count(distinct bool, nodes ...query.NodeI) uint
- func (b *MilestonesBuilder) Delete()
- func (b *MilestonesBuilder) Distinct() *MilestonesBuilder
- func (b *MilestonesBuilder) Expand(n query.NodeI) *MilestonesBuilder
- func (b *MilestonesBuilder) Get() *Milestone
- func (b *MilestonesBuilder) GroupBy(nodes ...query.NodeI) *MilestonesBuilder
- func (b *MilestonesBuilder) Having(node query.NodeI) *MilestonesBuilder
- func (b *MilestonesBuilder) Join(n query.NodeI, conditions ...query.NodeI) *MilestonesBuilder
- func (b *MilestonesBuilder) Limit(maxRowCount int, offset int) *MilestonesBuilder
- func (b *MilestonesBuilder) Load() (milestoneSlice []*Milestone)
- func (b *MilestonesBuilder) LoadCursor() milestoneCursor
- func (b *MilestonesBuilder) LoadI() (milestoneSlice []interface{})
- func (b *MilestonesBuilder) OrderBy(nodes ...query.NodeI) *MilestonesBuilder
- func (b *MilestonesBuilder) Select(nodes ...query.NodeI) *MilestonesBuilder
- func (b *MilestonesBuilder) Subquery() *query.SubqueryNode
- func (b *MilestonesBuilder) Where(c query.NodeI) *MilestonesBuilder
- type PeopleBuilder
- func (b *PeopleBuilder) Alias(name string, n query.NodeI) *PeopleBuilder
- func (b *PeopleBuilder) Count(distinct bool, nodes ...query.NodeI) uint
- func (b *PeopleBuilder) Delete()
- func (b *PeopleBuilder) Distinct() *PeopleBuilder
- func (b *PeopleBuilder) Expand(n query.NodeI) *PeopleBuilder
- func (b *PeopleBuilder) Get() *Person
- func (b *PeopleBuilder) GroupBy(nodes ...query.NodeI) *PeopleBuilder
- func (b *PeopleBuilder) Having(node query.NodeI) *PeopleBuilder
- func (b *PeopleBuilder) Join(n query.NodeI, conditions ...query.NodeI) *PeopleBuilder
- func (b *PeopleBuilder) Limit(maxRowCount int, offset int) *PeopleBuilder
- func (b *PeopleBuilder) Load() (personSlice []*Person)
- func (b *PeopleBuilder) LoadCursor() personCursor
- func (b *PeopleBuilder) LoadI() (personSlice []interface{})
- func (b *PeopleBuilder) OrderBy(nodes ...query.NodeI) *PeopleBuilder
- func (b *PeopleBuilder) Select(nodes ...query.NodeI) *PeopleBuilder
- func (b *PeopleBuilder) Subquery() *query.SubqueryNode
- func (b *PeopleBuilder) Where(c query.NodeI) *PeopleBuilder
- type Person
- func (o *Person) Address(pk string) *Address
- func (o *Person) Addresses() []*Address
- func (o *Person) Copy() (newObject *Person)
- func (o *Person) CountAddresses(ctx context.Context) int
- func (o *Person) CountProjects(ctx context.Context) int
- func (o *Person) CountProjectsAsManager(ctx context.Context) int
- func (o *Person) Delete(ctx context.Context)
- func (o *Person) EmployeeInfo() *EmployeeInfo
- func (o *Person) FirstName() string
- func (o *Person) FirstNameIsValid() bool
- func (o *Person) Get(key string) interface{}
- func (o *Person) GetAlias(key string) query.AliasValue
- func (o *Person) ID() string
- func (o *Person) IDIsValid() bool
- func (o *Person) Initialize()
- func (o *Person) IsDirty() (dirty bool)
- func (o *Person) IsNew() bool
- func (o *Person) LastName() string
- func (o *Person) LastNameIsValid() bool
- func (o *Person) LoadAddresses(ctx context.Context, conditions ...interface{}) []*Address
- func (o *Person) LoadEmployeeInfo(ctx context.Context) *EmployeeInfo
- func (o *Person) LoadLogin(ctx context.Context) *Login
- func (o *Person) LoadProjects(ctx context.Context)
- func (o *Person) LoadProjectsAsManager(ctx context.Context, conditions ...interface{}) []*Project
- func (o *Person) Login() *Login
- func (o *Person) MarshalBinary() ([]byte, error)
- func (o *Person) MarshalJSON() (data []byte, err error)
- func (o *Person) MarshalStringMap() map[string]interface{}
- func (o *Person) OriginalPrimaryKey() string
- func (o *Person) PersonTypes() []PersonType
- func (o *Person) PrimaryKey() string
- func (o *Person) Project(pk string) *Project
- func (o *Person) ProjectAsManager(pk string) *Project
- func (o *Person) Projects() []*Project
- func (o *Person) ProjectsAsManager() []*Project
- func (o *Person) Save(ctx context.Context)
- func (o *Person) SetAddressPrimaryKeys(pks []string)
- func (o *Person) SetAddresses(objs []*Address)
- func (o *Person) SetEmployeeInfo(obj *EmployeeInfo)
- func (o *Person) SetEmployeeInfoPrimaryKey(pk string)
- func (o *Person) SetFirstName(v string)
- func (o *Person) SetLastName(v string)
- func (o *Person) SetLogin(obj *Login)
- func (o *Person) SetLoginPrimaryKey(pk string)
- func (o *Person) SetPersonTypes(objs []PersonType)
- func (o *Person) SetProjectAsManagerPrimaryKeys(pks []string)
- func (o *Person) SetProjectPrimaryKeys(objs []string)
- func (o *Person) SetProjects(objs []*Project)
- func (o *Person) SetProjectsAsManager(objs []*Project)
- func (o *Person) String() string
- func (o *Person) UnmarshalBinary(data []byte) (err error)
- func (o *Person) UnmarshalJSON(data []byte) (err error)
- func (o *Person) UnmarshalStringMap(m map[string]interface{}) (err error)
- type PersonType
- type PersonWithLock
- func (o *PersonWithLock) Copy() (newObject *PersonWithLock)
- func (o *PersonWithLock) Delete(ctx context.Context)
- func (o *PersonWithLock) FirstName() string
- func (o *PersonWithLock) FirstNameIsValid() bool
- func (o *PersonWithLock) Get(key string) interface{}
- func (o *PersonWithLock) GetAlias(key string) query.AliasValue
- func (o *PersonWithLock) ID() string
- func (o *PersonWithLock) IDIsValid() bool
- func (o *PersonWithLock) Initialize()
- func (o *PersonWithLock) IsDirty() (dirty bool)
- func (o *PersonWithLock) IsNew() bool
- func (o *PersonWithLock) LastName() string
- func (o *PersonWithLock) LastNameIsValid() bool
- func (o *PersonWithLock) MarshalBinary() ([]byte, error)
- func (o *PersonWithLock) MarshalJSON() (data []byte, err error)
- func (o *PersonWithLock) MarshalStringMap() map[string]interface{}
- func (o *PersonWithLock) OriginalPrimaryKey() string
- func (o *PersonWithLock) PrimaryKey() string
- func (o *PersonWithLock) Save(ctx context.Context)
- func (o *PersonWithLock) SetFirstName(v string)
- func (o *PersonWithLock) SetLastName(v string)
- func (o *PersonWithLock) SetSysTimestamp(i interface{})
- func (o *PersonWithLock) String() string
- func (o *PersonWithLock) SysTimestamp() time.Time
- func (o *PersonWithLock) SysTimestampIsNull() bool
- func (o *PersonWithLock) SysTimestampIsValid() bool
- func (o *PersonWithLock) SysTimestamp_I() interface{}
- func (o *PersonWithLock) UnmarshalBinary(data []byte) (err error)
- func (o *PersonWithLock) UnmarshalJSON(data []byte) (err error)
- func (o *PersonWithLock) UnmarshalStringMap(m map[string]interface{}) (err error)
- type PersonWithLocksBuilder
- func (b *PersonWithLocksBuilder) Alias(name string, n query.NodeI) *PersonWithLocksBuilder
- func (b *PersonWithLocksBuilder) Count(distinct bool, nodes ...query.NodeI) uint
- func (b *PersonWithLocksBuilder) Delete()
- func (b *PersonWithLocksBuilder) Distinct() *PersonWithLocksBuilder
- func (b *PersonWithLocksBuilder) Expand(n query.NodeI) *PersonWithLocksBuilder
- func (b *PersonWithLocksBuilder) Get() *PersonWithLock
- func (b *PersonWithLocksBuilder) GroupBy(nodes ...query.NodeI) *PersonWithLocksBuilder
- func (b *PersonWithLocksBuilder) Having(node query.NodeI) *PersonWithLocksBuilder
- func (b *PersonWithLocksBuilder) Join(n query.NodeI, conditions ...query.NodeI) *PersonWithLocksBuilder
- func (b *PersonWithLocksBuilder) Limit(maxRowCount int, offset int) *PersonWithLocksBuilder
- func (b *PersonWithLocksBuilder) Load() (personWithLockSlice []*PersonWithLock)
- func (b *PersonWithLocksBuilder) LoadCursor() personWithLockCursor
- func (b *PersonWithLocksBuilder) LoadI() (personWithLockSlice []interface{})
- func (b *PersonWithLocksBuilder) OrderBy(nodes ...query.NodeI) *PersonWithLocksBuilder
- func (b *PersonWithLocksBuilder) Select(nodes ...query.NodeI) *PersonWithLocksBuilder
- func (b *PersonWithLocksBuilder) Subquery() *query.SubqueryNode
- func (b *PersonWithLocksBuilder) Where(c query.NodeI) *PersonWithLocksBuilder
- type Project
- func (o *Project) Budget() string
- func (o *Project) BudgetIsNull() bool
- func (o *Project) BudgetIsValid() bool
- func (o *Project) Budget_I() interface{}
- func (o *Project) Child(pk string) *Project
- func (o *Project) Children() []*Project
- func (o *Project) Copy() (newObject *Project)
- func (o *Project) CountChildren(ctx context.Context) int
- func (o *Project) CountMilestones(ctx context.Context) int
- func (o *Project) CountParents(ctx context.Context) int
- func (o *Project) CountTeamMembers(ctx context.Context) int
- func (o *Project) Delete(ctx context.Context)
- func (o *Project) Description() string
- func (o *Project) DescriptionIsNull() bool
- func (o *Project) DescriptionIsValid() bool
- func (o *Project) Description_I() interface{}
- func (o *Project) EndDate() time.Time
- func (o *Project) EndDateIsNull() bool
- func (o *Project) EndDateIsValid() bool
- func (o *Project) EndDate_I() interface{}
- func (o *Project) Get(key string) interface{}
- func (o *Project) GetAlias(key string) query.AliasValue
- func (o *Project) ID() string
- func (o *Project) IDIsValid() bool
- func (o *Project) Initialize()
- func (o *Project) IsDirty() (dirty bool)
- func (o *Project) IsNew() bool
- func (o *Project) LoadChildren(ctx context.Context)
- func (o *Project) LoadManager(ctx context.Context) *Person
- func (o *Project) LoadMilestones(ctx context.Context, conditions ...interface{}) []*Milestone
- func (o *Project) LoadParents(ctx context.Context)
- func (o *Project) LoadTeamMembers(ctx context.Context)
- func (o *Project) Manager() *Person
- func (o *Project) ManagerID() string
- func (o *Project) ManagerIDIsNull() bool
- func (o *Project) ManagerIDIsValid() bool
- func (o *Project) ManagerID_I() interface{}
- func (o *Project) MarshalBinary() ([]byte, error)
- func (o *Project) MarshalJSON() (data []byte, err error)
- func (o *Project) MarshalStringMap() map[string]interface{}
- func (o *Project) Milestone(pk string) *Milestone
- func (o *Project) Milestones() []*Milestone
- func (o *Project) Name() string
- func (o *Project) NameIsValid() bool
- func (o *Project) Num() int
- func (o *Project) NumIsValid() bool
- func (o *Project) OriginalPrimaryKey() string
- func (o *Project) Parent(pk string) *Project
- func (o *Project) Parents() []*Project
- func (o *Project) PrimaryKey() string
- func (o *Project) Save(ctx context.Context)
- func (o *Project) SetBudget(i interface{})
- func (o *Project) SetChildPrimaryKeys(objs []string)
- func (o *Project) SetChildren(objs []*Project)
- func (o *Project) SetDescription(i interface{})
- func (o *Project) SetEndDate(i interface{})
- func (o *Project) SetManager(v *Person)
- func (o *Project) SetManagerID(i interface{})
- func (o *Project) SetMilestonePrimaryKeys(pks []string)
- func (o *Project) SetMilestones(objs []*Milestone)
- func (o *Project) SetName(v string)
- func (o *Project) SetNum(v int)
- func (o *Project) SetParentPrimaryKeys(objs []string)
- func (o *Project) SetParents(objs []*Project)
- func (o *Project) SetSpent(i interface{})
- func (o *Project) SetStartDate(i interface{})
- func (o *Project) SetStatus(v ProjectStatus)
- func (o *Project) SetTeamMemberPrimaryKeys(objs []string)
- func (o *Project) SetTeamMembers(objs []*Person)
- func (o *Project) Spent() string
- func (o *Project) SpentIsNull() bool
- func (o *Project) SpentIsValid() bool
- func (o *Project) Spent_I() interface{}
- func (o *Project) StartDate() time.Time
- func (o *Project) StartDateIsNull() bool
- func (o *Project) StartDateIsValid() bool
- func (o *Project) StartDate_I() interface{}
- func (o *Project) Status() ProjectStatus
- func (o *Project) String() string
- func (o *Project) TeamMember(pk string) *Person
- func (o *Project) TeamMembers() []*Person
- func (o *Project) UnmarshalBinary(data []byte) (err error)
- func (o *Project) UnmarshalJSON(data []byte) (err error)
- func (o *Project) UnmarshalStringMap(m map[string]interface{}) (err error)
- type ProjectStatus
- func (p ProjectStatus) Description() string
- func (p ProjectStatus) Get(key string) interface{}
- func (p ProjectStatus) Guidelines() string
- func (p ProjectStatus) ID() string
- func (p ProjectStatus) IsActive() bool
- func (p ProjectStatus) Label() string
- func (p ProjectStatus) Name() string
- func (p ProjectStatus) String() string
- func (p ProjectStatus) Value() interface{}
- type ProjectsBuilder
- func (b *ProjectsBuilder) Alias(name string, n query.NodeI) *ProjectsBuilder
- func (b *ProjectsBuilder) Count(distinct bool, nodes ...query.NodeI) uint
- func (b *ProjectsBuilder) Delete()
- func (b *ProjectsBuilder) Distinct() *ProjectsBuilder
- func (b *ProjectsBuilder) Expand(n query.NodeI) *ProjectsBuilder
- func (b *ProjectsBuilder) Get() *Project
- func (b *ProjectsBuilder) GroupBy(nodes ...query.NodeI) *ProjectsBuilder
- func (b *ProjectsBuilder) Having(node query.NodeI) *ProjectsBuilder
- func (b *ProjectsBuilder) Join(n query.NodeI, conditions ...query.NodeI) *ProjectsBuilder
- func (b *ProjectsBuilder) Limit(maxRowCount int, offset int) *ProjectsBuilder
- func (b *ProjectsBuilder) Load() (projectSlice []*Project)
- func (b *ProjectsBuilder) LoadCursor() projectCursor
- func (b *ProjectsBuilder) LoadI() (projectSlice []interface{})
- func (b *ProjectsBuilder) OrderBy(nodes ...query.NodeI) *ProjectsBuilder
- func (b *ProjectsBuilder) Select(nodes ...query.NodeI) *ProjectsBuilder
- func (b *ProjectsBuilder) Subquery() *query.SubqueryNode
- func (b *ProjectsBuilder) Where(c query.NodeI) *ProjectsBuilder
Constants ¶
const ( AddressIDDefault = "" // id AddressPersonIDDefault = "" // person_id AddressStreetDefault = "" // street AddressCityDefault = "BOB" // city )
Default values for the fields in the address table. When a Address object is created, the fields in the object will be initialized to these values. doc: type=Address
const ( Address_ID = `ID` Address_PersonID = `PersonID` Address_Person = `Person` Address_Street = `Street` Address_City = `City` )
IDs used to access the Address object fields by name using the Get function. doc: type=Address
const ( EmployeeInfoIDDefault = "" // id EmployeeInfoPersonIDDefault = "" // person_id EmployeeInfoEmployeeNumberDefault = 0 // employee_number )
Default values for the fields in the employee_info table. When a EmployeeInfo object is created, the fields in the object will be initialized to these values. doc: type=EmployeeInfo
const ( EmployeeInfo_ID = `ID` EmployeeInfo_PersonID = `PersonID` EmployeeInfo_Person = `Person` EmployeeInfo_EmployeeNumber = `EmployeeNumber` )
IDs used to access the EmployeeInfo object fields by name using the Get function. doc: type=EmployeeInfo
const ( GiftNumberDefault = 0 // number GiftNameDefault = "" // name )
Default values for the fields in the gift table. When a Gift object is created, the fields in the object will be initialized to these values. doc: type=Gift
const ( Gift_Number = `Number` Gift_Name = `Name` )
IDs used to access the Gift object fields by name using the Get function. doc: type=Gift
const ( LoginIDDefault = "" // id LoginPersonIDDefault = "" // person_id LoginUsernameDefault = "" // username LoginPasswordDefault = "" // password LoginIsEnabledDefault = true // is_enabled )
Default values for the fields in the login table. When a Login object is created, the fields in the object will be initialized to these values. doc: type=Login
const ( Login_ID = `ID` Login_PersonID = `PersonID` Login_Person = `Person` Login_Username = `Username` Login_Password = `Password` Login_IsEnabled = `IsEnabled` )
IDs used to access the Login object fields by name using the Get function. doc: type=Login
const ( MilestoneIDDefault = "" // id MilestoneProjectIDDefault = "" // project_id MilestoneNameDefault = "" // name )
Default values for the fields in the milestone table. When a Milestone object is created, the fields in the object will be initialized to these values. doc: type=Milestone
const ( Milestone_ID = `ID` Milestone_ProjectID = `ProjectID` Milestone_Project = `Project` Milestone_Name = `Name` )
IDs used to access the Milestone object fields by name using the Get function. doc: type=Milestone
const ( PersonIDDefault = "" // id PersonFirstNameDefault = "" // first_name PersonLastNameDefault = "" // last_name )
Default values for the fields in the person table. When a Person object is created, the fields in the object will be initialized to these values. doc: type=Person
const ( Person_ID = `ID` Person_FirstName = `FirstName` Person_LastName = `LastName` PersonAddresses = `Addresses` PersonEmployeeInfo = `EmployeeInfo` PersonLogin = `Login` PersonProjectsAsManager = `ProjectsAsManager` PersonPersonType = `PersonType` PersonPersonTypes = `PersonTypes` PersonProject = `Project` PersonProjects = `Projects` )
IDs used to access the Person object fields by name using the Get function. doc: type=Person
const ( PersonWithLockIDDefault = "" // id PersonWithLockFirstNameDefault = "" // first_name PersonWithLockLastNameDefault = "" // last_name PersonWithLockSysTimestampDefault = time2.Zero // sys_timestamp )
Default values for the fields in the person_with_lock table. When a PersonWithLock object is created, the fields in the object will be initialized to these values. doc: type=PersonWithLock
const ( PersonWithLock_ID = `ID` PersonWithLock_FirstName = `FirstName` PersonWithLock_LastName = `LastName` PersonWithLock_SysTimestamp = `SysTimestamp` )
IDs used to access the PersonWithLock object fields by name using the Get function. doc: type=PersonWithLock
const ( ProjectIDDefault = "" // id ProjectNumDefault = 0 // num ProjectStatusIDDefault = 0 // status_id ProjectManagerIDDefault = "" // manager_id ProjectNameDefault = "" // name ProjectDescriptionDefault = "" // description ProjectStartDateDefault = time2.Zero // start_date ProjectEndDateDefault = time2.Zero // end_date ProjectBudgetDefault = "" // budget ProjectSpentDefault = "" // spent )
Default values for the fields in the project table. When a Project object is created, the fields in the object will be initialized to these values. doc: type=Project
const ( Project_ID = `ID` Project_Num = `Num` Project_StatusID = `StatusID` Project_ManagerID = `ManagerID` Project_Manager = `Manager` Project_Name = `Name` Project_Description = `Description` Project_StartDate = `StartDate` Project_EndDate = `EndDate` Project_Budget = `Budget` Project_Spent = `Spent` ProjectMilestones = `Milestones` ProjectChild = `Child` ProjectChildren = `Children` ProjectParent = `Parent` ProjectParents = `Parents` ProjectTeamMember = `TeamMember` ProjectTeamMembers = `TeamMembers` )
IDs used to access the Project object fields by name using the Get function. doc: type=Project
const PersonTypeMaxValue = 5
PersonTypeMaxValue is the maximum enumerated value of PersonType doc: type=PersonType
const ProjectStatusMaxValue = 4
ProjectStatusMaxValue is the maximum enumerated value of ProjectStatus doc: type=ProjectStatus
Variables ¶
This section is empty.
Functions ¶
func AllPersonTypesI ¶ added in v0.9.0
func AllPersonTypesI() (values []any)
AllPersonTypesI returns a slice of all the PersonType values as generic interfaces. doc: type=PersonType
func AllProjectStatusesI ¶ added in v0.27.0
func AllProjectStatusesI() (values []any)
AllProjectStatusesI returns a slice of all the ProjectStatus values as generic interfaces. doc: type=ProjectStatus
func CountAddressByCity ¶
CountAddressByCity queries the database and returns the number of Address objects that have the given city value. doc: type=Address
func CountAddressByID ¶
CountAddressByID queries the database and returns the number of Address objects that have the given id value. doc: type=Address
func CountAddressByPersonID ¶
CountAddressByPersonID queries the database and returns the number of Address objects that have the given personID value. doc: type=Address
func CountAddressByStreet ¶
CountAddressByStreet queries the database and returns the number of Address objects that have the given street value. doc: type=Address
func CountEmployeeInfoByEmployeeNumber ¶ added in v0.7.0
CountEmployeeInfoByEmployeeNumber queries the database and returns the number of EmployeeInfo objects that have the given employeeNumber value. doc: type=EmployeeInfo
func CountEmployeeInfoByID ¶ added in v0.7.0
CountEmployeeInfoByID queries the database and returns the number of EmployeeInfo objects that have the given id value. doc: type=EmployeeInfo
func CountEmployeeInfoByPersonID ¶ added in v0.7.0
CountEmployeeInfoByPersonID queries the database and returns the number of EmployeeInfo objects that have the given personID value. doc: type=EmployeeInfo
func CountGiftByName ¶ added in v0.13.9
CountGiftByName queries the database and returns the number of Gift objects that have the given name value. doc: type=Gift
func CountGiftByNumber ¶ added in v0.13.9
CountGiftByNumber queries the database and returns the number of Gift objects that have the given number value. doc: type=Gift
func CountLoginByID ¶
CountLoginByID queries the database and returns the number of Login objects that have the given id value. doc: type=Login
func CountLoginByIsEnabled ¶
CountLoginByIsEnabled queries the database and returns the number of Login objects that have the given isEnabled value. doc: type=Login
func CountLoginByPassword ¶
CountLoginByPassword queries the database and returns the number of Login objects that have the given password value. doc: type=Login
func CountLoginByPersonID ¶
CountLoginByPersonID queries the database and returns the number of Login objects that have the given personID value. doc: type=Login
func CountLoginByUsername ¶
CountLoginByUsername queries the database and returns the number of Login objects that have the given username value. doc: type=Login
func CountMilestoneByID ¶
CountMilestoneByID queries the database and returns the number of Milestone objects that have the given id value. doc: type=Milestone
func CountMilestoneByName ¶
CountMilestoneByName queries the database and returns the number of Milestone objects that have the given name value. doc: type=Milestone
func CountMilestoneByProjectID ¶
CountMilestoneByProjectID queries the database and returns the number of Milestone objects that have the given projectID value. doc: type=Milestone
func CountPersonByFirstName ¶
CountPersonByFirstName queries the database and returns the number of Person objects that have the given firstName value. doc: type=Person
func CountPersonByID ¶
CountPersonByID queries the database and returns the number of Person objects that have the given id value. doc: type=Person
func CountPersonByLastName ¶
CountPersonByLastName queries the database and returns the number of Person objects that have the given lastName value. doc: type=Person
func CountPersonWithLockByFirstName ¶
CountPersonWithLockByFirstName queries the database and returns the number of PersonWithLock objects that have the given firstName value. doc: type=PersonWithLock
func CountPersonWithLockByID ¶
CountPersonWithLockByID queries the database and returns the number of PersonWithLock objects that have the given id value. doc: type=PersonWithLock
func CountPersonWithLockByLastName ¶
CountPersonWithLockByLastName queries the database and returns the number of PersonWithLock objects that have the given lastName value. doc: type=PersonWithLock
func CountPersonWithLockBySysTimestamp ¶
CountPersonWithLockBySysTimestamp queries the database and returns the number of PersonWithLock objects that have the given sysTimestamp value. doc: type=PersonWithLock
func CountProjectByBudget ¶
CountProjectByBudget queries the database and returns the number of Project objects that have the given budget value. doc: type=Project
func CountProjectByDescription ¶
CountProjectByDescription queries the database and returns the number of Project objects that have the given description value. doc: type=Project
func CountProjectByEndDate ¶
CountProjectByEndDate queries the database and returns the number of Project objects that have the given endDate value. doc: type=Project
func CountProjectByID ¶
CountProjectByID queries the database and returns the number of Project objects that have the given id value. doc: type=Project
func CountProjectByManagerID ¶
CountProjectByManagerID queries the database and returns the number of Project objects that have the given managerID value. doc: type=Project
func CountProjectByName ¶
CountProjectByName queries the database and returns the number of Project objects that have the given name value. doc: type=Project
func CountProjectByNum ¶
CountProjectByNum queries the database and returns the number of Project objects that have the given num value. doc: type=Project
func CountProjectBySpent ¶
CountProjectBySpent queries the database and returns the number of Project objects that have the given spent value. doc: type=Project
func CountProjectByStartDate ¶
CountProjectByStartDate queries the database and returns the number of Project objects that have the given startDate value. doc: type=Project
func CountProjectByStatusID ¶ added in v0.27.0
CountProjectByStatusID queries the database and returns the number of Project objects that have the given statusID value. doc: type=Project
func Database ¶ added in v0.9.0
Database returns the database object corresponding to the goradd database.
func DeleteAddress ¶
DeleteAddress deletes the given record from the database. Note that you can also delete loaded Address objects by calling Delete on them.
func DeleteEmployeeInfo ¶ added in v0.7.0
DeleteEmployeeInfo deletes the given record from the database. Note that you can also delete loaded EmployeeInfo objects by calling Delete on them.
func DeleteGift ¶ added in v0.13.9
DeleteGift deletes the given record from the database. Note that you can also delete loaded Gift objects by calling Delete on them.
func DeleteLogin ¶
DeleteLogin deletes the given record from the database. Note that you can also delete loaded Login objects by calling Delete on them.
func DeleteMilestone ¶
DeleteMilestone deletes the given record from the database. Note that you can also delete loaded Milestone objects by calling Delete on them.
func DeletePerson ¶
DeletePerson deletes the given record from the database. Note that you can also delete loaded Person objects by calling Delete on them.
func DeletePersonWithLock ¶
DeletePersonWithLock deletes the given record from the database. Note that you can also delete loaded PersonWithLock objects by calling Delete on them.
func DeleteProject ¶
DeleteProject deletes the given record from the database. Note that you can also delete loaded Project objects by calling Delete on them.
func HasAddress ¶ added in v0.26.0
HasAddress returns true if a Address with the given primaryKey exists in the database. doc: type=Address
func HasEmployeeInfo ¶ added in v0.26.0
HasEmployeeInfo returns true if a EmployeeInfo with the given primaryKey exists in the database. doc: type=EmployeeInfo
func HasEmployeeInfoByPersonID ¶ added in v0.9.3
HasEmployeeInfoByPersonID returns true if the given unique index values exist in the database. doc: type=EmployeeInfo
func HasGift ¶ added in v0.26.0
HasGift returns true if a Gift with the given primaryKey exists in the database. doc: type=Gift
func HasLogin ¶ added in v0.26.0
HasLogin returns true if a Login with the given primaryKey exists in the database. doc: type=Login
func HasLoginByPersonID ¶ added in v0.9.3
HasLoginByPersonID returns true if the given unique index values exist in the database. doc: type=Login
func HasLoginByUsername ¶ added in v0.9.3
HasLoginByUsername returns true if the given unique index values exist in the database. doc: type=Login
func HasMilestone ¶ added in v0.26.0
HasMilestone returns true if a Milestone with the given primaryKey exists in the database. doc: type=Milestone
func HasPerson ¶ added in v0.26.0
HasPerson returns true if a Person with the given primaryKey exists in the database. doc: type=Person
func HasPersonWithLock ¶ added in v0.26.0
HasPersonWithLock returns true if a PersonWithLock with the given primaryKey exists in the database. doc: type=PersonWithLock
func HasProject ¶ added in v0.26.0
HasProject returns true if a Project with the given primaryKey exists in the database. doc: type=Project
func HasProjectByNum ¶ added in v0.9.3
HasProjectByNum returns true if the given unique index values exist in the database. doc: type=Project
func PersonTypeNames ¶
func PersonTypeNames() []string
PersonTypeNames returns a slice of all the Names associated with PersonType values. doc: type=PersonType
func ProjectStatusDescriptions ¶ added in v0.27.0
func ProjectStatusDescriptions() []string
ProjectStatusDescriptions returns a slice of all the Descriptions associated with ProjectStatus values. doc: type=ProjectStatus
func ProjectStatusGuidelines ¶ added in v0.27.0
func ProjectStatusGuidelines() []string
ProjectStatusGuidelines returns a slice of all the Guidelines associated with ProjectStatus values. doc: type=ProjectStatus
func ProjectStatusIsActives ¶ added in v0.27.0
func ProjectStatusIsActives() []bool
ProjectStatusIsActives returns a slice of all the IsActives associated with ProjectStatus values. doc: type=ProjectStatus
func ProjectStatusNames ¶ added in v0.27.0
func ProjectStatusNames() []string
ProjectStatusNames returns a slice of all the Names associated with ProjectStatus values. doc: type=ProjectStatus
Types ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
func LoadAddress ¶
LoadAddress returns a Address from the database. joinOrSelectNodes lets you provide nodes for joining to other tables or selecting specific fields. Table nodes will be considered Join nodes, and column nodes will be Select nodes. See AddressesBuilder.Join and AddressesBuilder.Select for more info.
func NewAddress ¶
func NewAddress() *Address
NewAddress creates a new Address object and initializes it to default values.
func (*Address) CityIsNull ¶
func (o *Address) CityIsNull() bool
CityIsNull returns true if the related database value is null.
func (*Address) CityIsValid ¶
func (o *Address) CityIsValid() bool
CityIsValid returns true if the value was loaded from the database or has been set.
func (*Address) City_I ¶ added in v0.12.0
func (o *Address) City_I() interface{}
City_I returns the loaded value of City as an interface. If the value in the database is NULL, a nil interface is returned.
func (*Address) Copy ¶ added in v0.27.2
func (o *Address) Copy() (newObject *Address)
Copy copies all valid fields (except for the primary key) to a new Address object. Forward reference ids will be copied, but reverse and many-many references will not. Call Save() on the new object to save it into the database.
func (*Address) Get ¶
func (o *Address) Get(key string) interface{}
Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil
func (*Address) GetAlias ¶
func (o *Address) GetAlias(key string) query.AliasValue
GetAlias returns the alias for the given key.
func (*Address) IDIsValid ¶
func (o *Address) IDIsValid() bool
IDIsValid returns true if the value was loaded from the database or has been set.
func (*Address) Initialize ¶
func (o *Address) Initialize()
Initialize will initialize or re-initialize a Address database object to default values.
func (*Address) IsDirty ¶
func (o *Address) IsDirty() (dirty bool)
IsDirty returns true if the object has been changed since it was read from the database.
func (*Address) IsNew ¶ added in v0.23.2
func (o *Address) IsNew() bool
IsNew returns true if the object will create a new record when saved.
func (*Address) LoadPerson ¶
LoadPerson returns the related Person. If it is not already loaded, it will attempt to load it first.
func (*Address) MarshalBinary ¶
MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.
func (*Address) MarshalJSON ¶
MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.
func (*Address) MarshalStringMap ¶ added in v0.15.0
func (o *Address) MarshalStringMap() map[string]interface{}
MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.
func (*Address) OriginalPrimaryKey ¶ added in v0.23.2
func (o *Address) OriginalPrimaryKey() string
OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.
func (*Address) Person ¶
func (o *Address) Person() *Person
Person returns the current value of the loaded Person, and nil if its not loaded.
func (*Address) PersonID ¶
func (o *Address) PersonID() string
PersonID returns the loaded value of PersonID.
func (*Address) PersonIDIsValid ¶
func (o *Address) PersonIDIsValid() bool
PersonIDIsValid returns true if the value was loaded from the database or has been set.
func (*Address) PrimaryKey ¶
func (o *Address) PrimaryKey() string
PrimaryKey returns the current value of the primary key field.
func (*Address) Save ¶
Save will update or insert the object, depending on the state of the object. If it has any auto-generated ids, those will be updated.
func (*Address) SetPerson ¶
func (o *Address) SetPerson(v *Person)
SetPerson sets the value of Person in the object, to be saved later using the Save() function.
func (*Address) SetPersonID ¶
func (o *Address) SetPersonID(v string)
SetPersonID sets the value of PersonID in the object, to be saved later using the Save() function.
func (*Address) SetStreet ¶
func (o *Address) SetStreet(v string)
SetStreet sets the value of Street in the object, to be saved later using the Save() function.
func (*Address) Street ¶
func (o *Address) Street() string
Street returns the loaded value of Street.
func (*Address) StreetIsValid ¶
func (o *Address) StreetIsValid() bool
StreetIsValid returns true if the value was loaded from the database or has been set.
func (*Address) String ¶
String implements the Stringer interface and returns the default label for the object as it appears in html lists. Typically you would change this to whatever was pertinent to your application.
func (*Address) UnmarshalBinary ¶
UnmarshalBinary converts a structure that was created with MarshalBinary into a Address object.
func (*Address) UnmarshalJSON ¶ added in v0.15.0
UnmarshalJSON unmarshalls the given json data into the address. The address can be a newly created object, or one loaded from the database.
After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.
Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.
The fields it expects are:
"id" - string "personID" - string "street" - string "city" - string, nullable
func (*Address) UnmarshalStringMap ¶ added in v0.15.0
UnmarshalStringMap will load the values from the stringmap into the object.
Override this in address to modify the json before sending it here.
type AddressesBuilder ¶
type AddressesBuilder struct {
// contains filtered or unexported fields
}
The AddressesBuilder uses the QueryBuilderI interface from the database to build a query. All query operations go through this query builder. End a query by calling either Load, Count, or Delete
func QueryAddresses ¶
func QueryAddresses(ctx context.Context) *AddressesBuilder
QueryAddresses returns a new builder that gives you general purpose access to the Address records in the database. Its here to give public access to the query builder, but you can remove it if you do not need it.
func (*AddressesBuilder) Alias ¶
func (b *AddressesBuilder) Alias(name string, n query.NodeI) *AddressesBuilder
Alias lets you add a node with a custom name. After the query, you can read out the data using GetAlias() on a returned object. Alias is useful for adding calculations or subqueries to the query.
func (*AddressesBuilder) Count ¶
func (b *AddressesBuilder) Count(distinct bool, nodes ...query.NodeI) uint
Count terminates a query and returns just the number of items selected.
distinct wll count the number of distinct items, ignoring duplicates.
nodes will select individual fields, and should be accompanied by a GroupBy.
func (*AddressesBuilder) Delete ¶
func (b *AddressesBuilder) Delete()
Delete uses the query builder to delete a group of records that match the criteria
func (*AddressesBuilder) Distinct ¶
func (b *AddressesBuilder) Distinct() *AddressesBuilder
Distinct removes duplicates from the results of the query. Adding a Select() may help you get to the data you want, although using Distinct with joined tables is often not effective, since we force joined tables to include primary keys in the query, and this often ruins the effect of Distinct.
func (*AddressesBuilder) Expand ¶
func (b *AddressesBuilder) Expand(n query.NodeI) *AddressesBuilder
Expand expands an array type node so that it will produce individual rows instead of an array of items
func (*AddressesBuilder) Get ¶
func (b *AddressesBuilder) Get() *Address
Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items.
func (*AddressesBuilder) GroupBy ¶
func (b *AddressesBuilder) GroupBy(nodes ...query.NodeI) *AddressesBuilder
GroupBy controls how results are grouped when using aggregate functions in an Alias() call.
func (*AddressesBuilder) Having ¶
func (b *AddressesBuilder) Having(node query.NodeI) *AddressesBuilder
Having does additional filtering on the results of the query.
func (*AddressesBuilder) Join ¶
func (b *AddressesBuilder) Join(n query.NodeI, conditions ...query.NodeI) *AddressesBuilder
Join adds a node to the node tree so that its fields will appear in the query. Optionally add conditions to filter what gets included. The conditions will be AND'd with the basic condition matching the primary keys of the join.
func (*AddressesBuilder) Limit ¶
func (b *AddressesBuilder) Limit(maxRowCount int, offset int) *AddressesBuilder
Limit will return a subset of the data, limited to the offset and number of rows specified
func (*AddressesBuilder) Load ¶
func (b *AddressesBuilder) Load() (addressSlice []*Address)
Load terminates the query builder, performs the query, and returns a slice of Address objects. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice
func (*AddressesBuilder) LoadCursor ¶ added in v0.19.2
func (b *AddressesBuilder) LoadCursor() addressCursor
LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.
A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.
Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use
defer cursor.Close()
to make sure the cursor gets closed.
func (*AddressesBuilder) LoadI ¶
func (b *AddressesBuilder) LoadI() (addressSlice []interface{})
LoadI terminates the query builder, performs the query, and returns a slice of interfaces. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice.
func (*AddressesBuilder) OrderBy ¶
func (b *AddressesBuilder) OrderBy(nodes ...query.NodeI) *AddressesBuilder
OrderBy specifies how the resulting data should be sorted.
func (*AddressesBuilder) Select ¶
func (b *AddressesBuilder) Select(nodes ...query.NodeI) *AddressesBuilder
Select optimizes the query to only return the specified fields. Once you put a Select in your query, you must specify all the fields that you will eventually read out. Be careful when selecting fields in joined tables, as joined tables will also contain pointers back to the parent table, and so the parent node should have the same field selected as the child node if you are querying those fields.
func (*AddressesBuilder) Subquery ¶
func (b *AddressesBuilder) Subquery() *query.SubqueryNode
Subquery uses the query builder to define a subquery within a larger query. You MUST include what you are selecting by adding Alias or Select functions on the subquery builder. Generally you would use this as a node to an Alias function on the surrounding query builder.
func (*AddressesBuilder) Where ¶
func (b *AddressesBuilder) Where(c query.NodeI) *AddressesBuilder
Where adds a condition to filter what gets selected.
type EmployeeInfo ¶ added in v0.7.0
type EmployeeInfo struct {
// contains filtered or unexported fields
}
func LoadEmployeeInfo ¶ added in v0.7.0
func LoadEmployeeInfo(ctx context.Context, primaryKey string, joinOrSelectNodes ...query.NodeI) *EmployeeInfo
LoadEmployeeInfo returns a EmployeeInfo from the database. joinOrSelectNodes lets you provide nodes for joining to other tables or selecting specific fields. Table nodes will be considered Join nodes, and column nodes will be Select nodes. See EmployeeInfosBuilder.Join and EmployeeInfosBuilder.Select for more info.
func LoadEmployeeInfoByPersonID ¶ added in v0.7.0
func LoadEmployeeInfoByPersonID(ctx context.Context, personID string, joinOrSelectNodes ...query.NodeI) *EmployeeInfo
LoadEmployeeInfoByPersonID queries for a single EmployeeInfo object by the given unique index values. joinOrSelectNodes lets you provide nodes for joining to other tables or selecting specific fields. Table nodes will be considered Join nodes, and column nodes will be Select nodes. See EmployeeInfosBuilder.Join and EmployeeInfosBuilder.Select for more info. If you need a more elaborate query, use QueryEmployeeInfos() to start a query builder.
func NewEmployeeInfo ¶ added in v0.7.0
func NewEmployeeInfo() *EmployeeInfo
NewEmployeeInfo creates a new EmployeeInfo object and initializes it to default values.
func (*EmployeeInfo) Copy ¶ added in v0.27.2
func (o *EmployeeInfo) Copy() (newObject *EmployeeInfo)
Copy copies all valid fields (except for the primary key) to a new EmployeeInfo object. Forward reference ids will be copied, but reverse and many-many references will not. Call Save() on the new object to save it into the database.
func (*EmployeeInfo) Delete ¶ added in v0.7.0
Delete deletes the associated record from the database.
func (*EmployeeInfo) EmployeeNumber ¶ added in v0.7.0
func (o *EmployeeInfo) EmployeeNumber() int
EmployeeNumber returns the loaded value of EmployeeNumber.
func (*EmployeeInfo) EmployeeNumberIsValid ¶ added in v0.7.0
func (o *EmployeeInfo) EmployeeNumberIsValid() bool
EmployeeNumberIsValid returns true if the value was loaded from the database or has been set.
func (*EmployeeInfo) Get ¶ added in v0.7.0
func (o *EmployeeInfo) Get(key string) interface{}
Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil
func (*EmployeeInfo) GetAlias ¶ added in v0.7.0
func (o *EmployeeInfo) GetAlias(key string) query.AliasValue
GetAlias returns the alias for the given key.
func (*EmployeeInfo) ID ¶ added in v0.7.0
func (o *EmployeeInfo) ID() string
ID returns the loaded value of ID.
func (*EmployeeInfo) IDIsValid ¶ added in v0.7.0
func (o *EmployeeInfo) IDIsValid() bool
IDIsValid returns true if the value was loaded from the database or has been set.
func (*EmployeeInfo) Initialize ¶ added in v0.7.0
func (o *EmployeeInfo) Initialize()
Initialize will initialize or re-initialize a EmployeeInfo database object to default values.
func (*EmployeeInfo) IsDirty ¶ added in v0.7.0
func (o *EmployeeInfo) IsDirty() (dirty bool)
IsDirty returns true if the object has been changed since it was read from the database.
func (*EmployeeInfo) IsNew ¶ added in v0.23.2
func (o *EmployeeInfo) IsNew() bool
IsNew returns true if the object will create a new record when saved.
func (*EmployeeInfo) LoadPerson ¶ added in v0.7.0
LoadPerson returns the related Person. If it is not already loaded, it will attempt to load it first.
func (*EmployeeInfo) MarshalBinary ¶ added in v0.7.0
MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.
func (*EmployeeInfo) MarshalJSON ¶ added in v0.7.0
MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.
func (*EmployeeInfo) MarshalStringMap ¶ added in v0.15.0
func (o *EmployeeInfo) MarshalStringMap() map[string]interface{}
MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.
func (*EmployeeInfo) OriginalPrimaryKey ¶ added in v0.23.2
func (o *EmployeeInfo) OriginalPrimaryKey() string
OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.
func (*EmployeeInfo) Person ¶ added in v0.7.0
func (o *EmployeeInfo) Person() *Person
Person returns the current value of the loaded Person, and nil if its not loaded.
func (*EmployeeInfo) PersonID ¶ added in v0.7.0
func (o *EmployeeInfo) PersonID() string
PersonID returns the loaded value of PersonID.
func (*EmployeeInfo) PersonIDIsValid ¶ added in v0.7.0
func (o *EmployeeInfo) PersonIDIsValid() bool
PersonIDIsValid returns true if the value was loaded from the database or has been set.
func (*EmployeeInfo) PrimaryKey ¶ added in v0.7.0
func (o *EmployeeInfo) PrimaryKey() string
PrimaryKey returns the current value of the primary key field.
func (*EmployeeInfo) Save ¶ added in v0.7.0
Save will update or insert the object, depending on the state of the object. If it has any auto-generated ids, those will be updated.
func (*EmployeeInfo) SetEmployeeNumber ¶ added in v0.7.0
func (o *EmployeeInfo) SetEmployeeNumber(v int)
SetEmployeeNumber sets the value of EmployeeNumber in the object, to be saved later using the Save() function.
func (*EmployeeInfo) SetPerson ¶ added in v0.7.0
func (o *EmployeeInfo) SetPerson(v *Person)
SetPerson sets the value of Person in the object, to be saved later using the Save() function.
func (*EmployeeInfo) SetPersonID ¶ added in v0.7.0
func (o *EmployeeInfo) SetPersonID(v string)
SetPersonID sets the value of PersonID in the object, to be saved later using the Save() function.
func (*EmployeeInfo) String ¶ added in v0.7.0
func (o *EmployeeInfo) String() string
String implements the Stringer interface and returns the default label for the object as it appears in html lists. Typically you would change this to whatever was pertinent to your application.
func (*EmployeeInfo) UnmarshalBinary ¶ added in v0.7.0
UnmarshalBinary converts a structure that was created with MarshalBinary into a EmployeeInfo object.
func (*EmployeeInfo) UnmarshalJSON ¶ added in v0.15.0
UnmarshalJSON unmarshalls the given json data into the employeeInfo. The employeeInfo can be a newly created object, or one loaded from the database.
After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.
Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.
The fields it expects are:
"id" - string "personID" - string "employeeNumber" - int
func (*EmployeeInfo) UnmarshalStringMap ¶ added in v0.15.0
UnmarshalStringMap will load the values from the stringmap into the object.
Override this in employeeInfo to modify the json before sending it here.
type EmployeeInfosBuilder ¶ added in v0.7.0
type EmployeeInfosBuilder struct {
// contains filtered or unexported fields
}
The EmployeeInfosBuilder uses the QueryBuilderI interface from the database to build a query. All query operations go through this query builder. End a query by calling either Load, Count, or Delete
func QueryEmployeeInfos ¶ added in v0.7.0
func QueryEmployeeInfos(ctx context.Context) *EmployeeInfosBuilder
QueryEmployeeInfos returns a new builder that gives you general purpose access to the EmployeeInfo records in the database. Its here to give public access to the query builder, but you can remove it if you do not need it.
func (*EmployeeInfosBuilder) Alias ¶ added in v0.7.0
func (b *EmployeeInfosBuilder) Alias(name string, n query.NodeI) *EmployeeInfosBuilder
Alias lets you add a node with a custom name. After the query, you can read out the data using GetAlias() on a returned object. Alias is useful for adding calculations or subqueries to the query.
func (*EmployeeInfosBuilder) Count ¶ added in v0.7.0
func (b *EmployeeInfosBuilder) Count(distinct bool, nodes ...query.NodeI) uint
Count terminates a query and returns just the number of items selected.
distinct wll count the number of distinct items, ignoring duplicates.
nodes will select individual fields, and should be accompanied by a GroupBy.
func (*EmployeeInfosBuilder) Delete ¶ added in v0.7.0
func (b *EmployeeInfosBuilder) Delete()
Delete uses the query builder to delete a group of records that match the criteria
func (*EmployeeInfosBuilder) Distinct ¶ added in v0.7.0
func (b *EmployeeInfosBuilder) Distinct() *EmployeeInfosBuilder
Distinct removes duplicates from the results of the query. Adding a Select() may help you get to the data you want, although using Distinct with joined tables is often not effective, since we force joined tables to include primary keys in the query, and this often ruins the effect of Distinct.
func (*EmployeeInfosBuilder) Expand ¶ added in v0.7.0
func (b *EmployeeInfosBuilder) Expand(n query.NodeI) *EmployeeInfosBuilder
Expand expands an array type node so that it will produce individual rows instead of an array of items
func (*EmployeeInfosBuilder) Get ¶ added in v0.7.0
func (b *EmployeeInfosBuilder) Get() *EmployeeInfo
Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items.
func (*EmployeeInfosBuilder) GroupBy ¶ added in v0.7.0
func (b *EmployeeInfosBuilder) GroupBy(nodes ...query.NodeI) *EmployeeInfosBuilder
GroupBy controls how results are grouped when using aggregate functions in an Alias() call.
func (*EmployeeInfosBuilder) Having ¶ added in v0.7.0
func (b *EmployeeInfosBuilder) Having(node query.NodeI) *EmployeeInfosBuilder
Having does additional filtering on the results of the query.
func (*EmployeeInfosBuilder) Join ¶ added in v0.7.0
func (b *EmployeeInfosBuilder) Join(n query.NodeI, conditions ...query.NodeI) *EmployeeInfosBuilder
Join adds a node to the node tree so that its fields will appear in the query. Optionally add conditions to filter what gets included. The conditions will be AND'd with the basic condition matching the primary keys of the join.
func (*EmployeeInfosBuilder) Limit ¶ added in v0.7.0
func (b *EmployeeInfosBuilder) Limit(maxRowCount int, offset int) *EmployeeInfosBuilder
Limit will return a subset of the data, limited to the offset and number of rows specified
func (*EmployeeInfosBuilder) Load ¶ added in v0.7.0
func (b *EmployeeInfosBuilder) Load() (employeeInfoSlice []*EmployeeInfo)
Load terminates the query builder, performs the query, and returns a slice of EmployeeInfo objects. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice
func (*EmployeeInfosBuilder) LoadCursor ¶ added in v0.19.2
func (b *EmployeeInfosBuilder) LoadCursor() employeeInfoCursor
LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.
A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.
Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use
defer cursor.Close()
to make sure the cursor gets closed.
func (*EmployeeInfosBuilder) LoadI ¶ added in v0.7.0
func (b *EmployeeInfosBuilder) LoadI() (employeeInfoSlice []interface{})
LoadI terminates the query builder, performs the query, and returns a slice of interfaces. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice.
func (*EmployeeInfosBuilder) OrderBy ¶ added in v0.7.0
func (b *EmployeeInfosBuilder) OrderBy(nodes ...query.NodeI) *EmployeeInfosBuilder
OrderBy specifies how the resulting data should be sorted.
func (*EmployeeInfosBuilder) Select ¶ added in v0.7.0
func (b *EmployeeInfosBuilder) Select(nodes ...query.NodeI) *EmployeeInfosBuilder
Select optimizes the query to only return the specified fields. Once you put a Select in your query, you must specify all the fields that you will eventually read out. Be careful when selecting fields in joined tables, as joined tables will also contain pointers back to the parent table, and so the parent node should have the same field selected as the child node if you are querying those fields.
func (*EmployeeInfosBuilder) Subquery ¶ added in v0.7.0
func (b *EmployeeInfosBuilder) Subquery() *query.SubqueryNode
Subquery uses the query builder to define a subquery within a larger query. You MUST include what you are selecting by adding Alias or Select functions on the subquery builder. Generally you would use this as a node to an Alias function on the surrounding query builder.
func (*EmployeeInfosBuilder) Where ¶ added in v0.7.0
func (b *EmployeeInfosBuilder) Where(c query.NodeI) *EmployeeInfosBuilder
Where adds a condition to filter what gets selected.
type Gift ¶ added in v0.13.9
type Gift struct {
// contains filtered or unexported fields
}
func LoadGift ¶ added in v0.13.9
LoadGift returns a Gift from the database. joinOrSelectNodes lets you provide nodes for joining to other tables or selecting specific fields. Table nodes will be considered Join nodes, and column nodes will be Select nodes. See GiftsBuilder.Join and GiftsBuilder.Select for more info.
func NewGift ¶ added in v0.13.9
func NewGift() *Gift
NewGift creates a new Gift object and initializes it to default values.
func (*Gift) Copy ¶ added in v0.27.2
func (o *Gift) Copy() (newObject *Gift)
Copy copies all valid fields (except for the primary key) to a new Gift object. Forward reference ids will be copied, but reverse and many-many references will not. Call Save() on the new object to save it into the database.
func (*Gift) Get ¶ added in v0.13.9
func (o *Gift) Get(key string) interface{}
Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil
func (*Gift) GetAlias ¶ added in v0.13.9
func (o *Gift) GetAlias(key string) query.AliasValue
GetAlias returns the alias for the given key.
func (*Gift) Initialize ¶ added in v0.13.9
func (o *Gift) Initialize()
Initialize will initialize or re-initialize a Gift database object to default values.
func (*Gift) IsDirty ¶ added in v0.13.9
func (o *Gift) IsDirty() (dirty bool)
IsDirty returns true if the object has been changed since it was read from the database.
func (*Gift) IsNew ¶ added in v0.23.2
func (o *Gift) IsNew() bool
IsNew returns true if the object will create a new record when saved.
func (*Gift) MarshalBinary ¶ added in v0.13.9
MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.
func (*Gift) MarshalJSON ¶ added in v0.13.9
MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.
func (*Gift) MarshalStringMap ¶ added in v0.15.0
func (o *Gift) MarshalStringMap() map[string]interface{}
MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.
func (*Gift) Name ¶ added in v0.13.9
func (o *Gift) Name() string
Name returns the loaded value of Name.
func (*Gift) NameIsValid ¶ added in v0.13.9
func (o *Gift) NameIsValid() bool
NameIsValid returns true if the value was loaded from the database or has been set.
func (*Gift) Number ¶ added in v0.13.9
func (o *Gift) Number() int
Number returns the loaded value of Number.
func (*Gift) NumberIsValid ¶ added in v0.13.9
func (o *Gift) NumberIsValid() bool
NumberIsValid returns true if the value was loaded from the database or has been set.
func (*Gift) OriginalPrimaryKey ¶ added in v0.23.2
func (o *Gift) OriginalPrimaryKey() int
OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.
func (*Gift) PrimaryKey ¶ added in v0.13.9
func (o *Gift) PrimaryKey() int
PrimaryKey returns the current value of the primary key field.
func (*Gift) Save ¶ added in v0.13.9
Save will update or insert the object, depending on the state of the object. If it has any auto-generated ids, those will be updated.
func (*Gift) SetName ¶ added in v0.13.9
func (o *Gift) SetName(v string)
SetName sets the value of Name in the object, to be saved later using the Save() function.
func (*Gift) SetNumber ¶ added in v0.13.9
func (o *Gift) SetNumber(v int)
SetNumber sets the value of Number in the object, to be saved later using the Save() function.
func (*Gift) String ¶ added in v0.13.9
String implements the Stringer interface and returns the default label for the object as it appears in html lists. Typically you would change this to whatever was pertinent to your application.
func (*Gift) UnmarshalBinary ¶ added in v0.13.9
UnmarshalBinary converts a structure that was created with MarshalBinary into a Gift object.
func (*Gift) UnmarshalJSON ¶ added in v0.15.0
UnmarshalJSON unmarshalls the given json data into the gift. The gift can be a newly created object, or one loaded from the database.
After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.
Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.
The fields it expects are:
"number" - int "name" - string
func (*Gift) UnmarshalStringMap ¶ added in v0.15.0
UnmarshalStringMap will load the values from the stringmap into the object.
Override this in gift to modify the json before sending it here.
type GiftsBuilder ¶ added in v0.13.9
type GiftsBuilder struct {
// contains filtered or unexported fields
}
The GiftsBuilder uses the QueryBuilderI interface from the database to build a query. All query operations go through this query builder. End a query by calling either Load, Count, or Delete
func QueryGifts ¶ added in v0.13.9
func QueryGifts(ctx context.Context) *GiftsBuilder
QueryGifts returns a new builder that gives you general purpose access to the Gift records in the database. Its here to give public access to the query builder, but you can remove it if you do not need it.
func (*GiftsBuilder) Alias ¶ added in v0.13.9
func (b *GiftsBuilder) Alias(name string, n query.NodeI) *GiftsBuilder
Alias lets you add a node with a custom name. After the query, you can read out the data using GetAlias() on a returned object. Alias is useful for adding calculations or subqueries to the query.
func (*GiftsBuilder) Count ¶ added in v0.13.9
func (b *GiftsBuilder) Count(distinct bool, nodes ...query.NodeI) uint
Count terminates a query and returns just the number of items selected.
distinct wll count the number of distinct items, ignoring duplicates.
nodes will select individual fields, and should be accompanied by a GroupBy.
func (*GiftsBuilder) Delete ¶ added in v0.13.9
func (b *GiftsBuilder) Delete()
Delete uses the query builder to delete a group of records that match the criteria
func (*GiftsBuilder) Distinct ¶ added in v0.13.9
func (b *GiftsBuilder) Distinct() *GiftsBuilder
Distinct removes duplicates from the results of the query. Adding a Select() may help you get to the data you want, although using Distinct with joined tables is often not effective, since we force joined tables to include primary keys in the query, and this often ruins the effect of Distinct.
func (*GiftsBuilder) Expand ¶ added in v0.13.9
func (b *GiftsBuilder) Expand(n query.NodeI) *GiftsBuilder
Expand expands an array type node so that it will produce individual rows instead of an array of items
func (*GiftsBuilder) Get ¶ added in v0.13.9
func (b *GiftsBuilder) Get() *Gift
Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items.
func (*GiftsBuilder) GroupBy ¶ added in v0.13.9
func (b *GiftsBuilder) GroupBy(nodes ...query.NodeI) *GiftsBuilder
GroupBy controls how results are grouped when using aggregate functions in an Alias() call.
func (*GiftsBuilder) Having ¶ added in v0.13.9
func (b *GiftsBuilder) Having(node query.NodeI) *GiftsBuilder
Having does additional filtering on the results of the query.
func (*GiftsBuilder) Join ¶ added in v0.13.9
func (b *GiftsBuilder) Join(n query.NodeI, conditions ...query.NodeI) *GiftsBuilder
Join adds a node to the node tree so that its fields will appear in the query. Optionally add conditions to filter what gets included. The conditions will be AND'd with the basic condition matching the primary keys of the join.
func (*GiftsBuilder) Limit ¶ added in v0.13.9
func (b *GiftsBuilder) Limit(maxRowCount int, offset int) *GiftsBuilder
Limit will return a subset of the data, limited to the offset and number of rows specified
func (*GiftsBuilder) Load ¶ added in v0.13.9
func (b *GiftsBuilder) Load() (giftSlice []*Gift)
Load terminates the query builder, performs the query, and returns a slice of Gift objects. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice
func (*GiftsBuilder) LoadCursor ¶ added in v0.19.2
func (b *GiftsBuilder) LoadCursor() giftCursor
LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.
A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.
Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use
defer cursor.Close()
to make sure the cursor gets closed.
func (*GiftsBuilder) LoadI ¶ added in v0.13.9
func (b *GiftsBuilder) LoadI() (giftSlice []interface{})
LoadI terminates the query builder, performs the query, and returns a slice of interfaces. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice.
func (*GiftsBuilder) OrderBy ¶ added in v0.13.9
func (b *GiftsBuilder) OrderBy(nodes ...query.NodeI) *GiftsBuilder
OrderBy specifies how the resulting data should be sorted.
func (*GiftsBuilder) Select ¶ added in v0.13.9
func (b *GiftsBuilder) Select(nodes ...query.NodeI) *GiftsBuilder
Select optimizes the query to only return the specified fields. Once you put a Select in your query, you must specify all the fields that you will eventually read out. Be careful when selecting fields in joined tables, as joined tables will also contain pointers back to the parent table, and so the parent node should have the same field selected as the child node if you are querying those fields.
func (*GiftsBuilder) Subquery ¶ added in v0.13.9
func (b *GiftsBuilder) Subquery() *query.SubqueryNode
Subquery uses the query builder to define a subquery within a larger query. You MUST include what you are selecting by adding Alias or Select functions on the subquery builder. Generally you would use this as a node to an Alias function on the surrounding query builder.
func (*GiftsBuilder) Where ¶ added in v0.13.9
func (b *GiftsBuilder) Where(c query.NodeI) *GiftsBuilder
Where adds a condition to filter what gets selected.
type Login ¶
type Login struct {
// contains filtered or unexported fields
}
func LoadLogin ¶
LoadLogin returns a Login from the database. joinOrSelectNodes lets you provide nodes for joining to other tables or selecting specific fields. Table nodes will be considered Join nodes, and column nodes will be Select nodes. See LoginsBuilder.Join and LoginsBuilder.Select for more info.
func LoadLoginByPersonID ¶
func LoadLoginByPersonID(ctx context.Context, personID interface{}, joinOrSelectNodes ...query.NodeI) *Login
LoadLoginByPersonID queries for a single Login object by the given unique index values. joinOrSelectNodes lets you provide nodes for joining to other tables or selecting specific fields. Table nodes will be considered Join nodes, and column nodes will be Select nodes. See LoginsBuilder.Join and LoginsBuilder.Select for more info. If you need a more elaborate query, use QueryLogins() to start a query builder.
func LoadLoginByUsername ¶
func LoadLoginByUsername(ctx context.Context, username string, joinOrSelectNodes ...query.NodeI) *Login
LoadLoginByUsername queries for a single Login object by the given unique index values. joinOrSelectNodes lets you provide nodes for joining to other tables or selecting specific fields. Table nodes will be considered Join nodes, and column nodes will be Select nodes. See LoginsBuilder.Join and LoginsBuilder.Select for more info. If you need a more elaborate query, use QueryLogins() to start a query builder.
func NewLogin ¶
func NewLogin() *Login
NewLogin creates a new Login object and initializes it to default values.
func (*Login) Copy ¶ added in v0.27.2
func (o *Login) Copy() (newObject *Login)
Copy copies all valid fields (except for the primary key) to a new Login object. Forward reference ids will be copied, but reverse and many-many references will not. Call Save() on the new object to save it into the database.
func (*Login) Get ¶
func (o *Login) Get(key string) interface{}
Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil
func (*Login) GetAlias ¶
func (o *Login) GetAlias(key string) query.AliasValue
GetAlias returns the alias for the given key.
func (*Login) IDIsValid ¶
func (o *Login) IDIsValid() bool
IDIsValid returns true if the value was loaded from the database or has been set.
func (*Login) Initialize ¶
func (o *Login) Initialize()
Initialize will initialize or re-initialize a Login database object to default values.
func (*Login) IsDirty ¶
func (o *Login) IsDirty() (dirty bool)
IsDirty returns true if the object has been changed since it was read from the database.
func (*Login) IsEnabled ¶
func (o *Login) IsEnabled() bool
IsEnabled returns the loaded value of IsEnabled.
func (*Login) IsEnabledIsValid ¶
func (o *Login) IsEnabledIsValid() bool
IsEnabledIsValid returns true if the value was loaded from the database or has been set.
func (*Login) IsNew ¶ added in v0.23.2
func (o *Login) IsNew() bool
IsNew returns true if the object will create a new record when saved.
func (*Login) LoadPerson ¶
LoadPerson returns the related Person. If it is not already loaded, it will attempt to load it first.
func (*Login) MarshalBinary ¶
MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.
func (*Login) MarshalJSON ¶
MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.
func (*Login) MarshalStringMap ¶ added in v0.15.0
func (o *Login) MarshalStringMap() map[string]interface{}
MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.
func (*Login) OriginalPrimaryKey ¶ added in v0.23.2
func (o *Login) OriginalPrimaryKey() string
OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.
func (*Login) Password ¶
func (o *Login) Password() string
Password returns the loaded value of Password.
func (*Login) PasswordIsNull ¶
func (o *Login) PasswordIsNull() bool
PasswordIsNull returns true if the related database value is null.
func (*Login) PasswordIsValid ¶
func (o *Login) PasswordIsValid() bool
PasswordIsValid returns true if the value was loaded from the database or has been set.
func (*Login) Password_I ¶ added in v0.12.0
func (o *Login) Password_I() interface{}
Password_I returns the loaded value of Password as an interface. If the value in the database is NULL, a nil interface is returned.
func (*Login) Person ¶
func (o *Login) Person() *Person
Person returns the current value of the loaded Person, and nil if its not loaded.
func (*Login) PersonID ¶
func (o *Login) PersonID() string
PersonID returns the loaded value of PersonID.
func (*Login) PersonIDIsNull ¶
func (o *Login) PersonIDIsNull() bool
PersonIDIsNull returns true if the related database value is null.
func (*Login) PersonIDIsValid ¶
func (o *Login) PersonIDIsValid() bool
PersonIDIsValid returns true if the value was loaded from the database or has been set.
func (*Login) PersonID_I ¶ added in v0.12.0
func (o *Login) PersonID_I() interface{}
PersonID_I returns the loaded value of PersonID as an interface. If the value in the database is NULL, a nil interface is returned.
func (*Login) PrimaryKey ¶
func (o *Login) PrimaryKey() string
PrimaryKey returns the current value of the primary key field.
func (*Login) Save ¶
Save will update or insert the object, depending on the state of the object. If it has any auto-generated ids, those will be updated.
func (*Login) SetIsEnabled ¶
func (o *Login) SetIsEnabled(v bool)
SetIsEnabled sets the value of IsEnabled in the object, to be saved later using the Save() function.
func (*Login) SetPassword ¶
func (o *Login) SetPassword(i interface{})
func (*Login) SetPersonID ¶
func (o *Login) SetPersonID(i interface{})
func (*Login) SetUsername ¶
func (o *Login) SetUsername(v string)
SetUsername sets the value of Username in the object, to be saved later using the Save() function.
func (*Login) String ¶
String implements the Stringer interface and returns the default label for the object as it appears in html lists. Typically you would change this to whatever was pertinent to your application.
func (*Login) UnmarshalBinary ¶
UnmarshalBinary converts a structure that was created with MarshalBinary into a Login object.
func (*Login) UnmarshalJSON ¶ added in v0.15.0
UnmarshalJSON unmarshalls the given json data into the login. The login can be a newly created object, or one loaded from the database.
After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.
Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.
The fields it expects are:
"id" - string "personID" - string, nullable "username" - string "password" - string, nullable "isEnabled" - bool
func (*Login) UnmarshalStringMap ¶ added in v0.15.0
UnmarshalStringMap will load the values from the stringmap into the object.
Override this in login to modify the json before sending it here.
func (*Login) Username ¶
func (o *Login) Username() string
Username returns the loaded value of Username.
func (*Login) UsernameIsValid ¶
func (o *Login) UsernameIsValid() bool
UsernameIsValid returns true if the value was loaded from the database or has been set.
type LoginsBuilder ¶
type LoginsBuilder struct {
// contains filtered or unexported fields
}
The LoginsBuilder uses the QueryBuilderI interface from the database to build a query. All query operations go through this query builder. End a query by calling either Load, Count, or Delete
func QueryLogins ¶
func QueryLogins(ctx context.Context) *LoginsBuilder
QueryLogins returns a new builder that gives you general purpose access to the Login records in the database. Its here to give public access to the query builder, but you can remove it if you do not need it.
func (*LoginsBuilder) Alias ¶
func (b *LoginsBuilder) Alias(name string, n query.NodeI) *LoginsBuilder
Alias lets you add a node with a custom name. After the query, you can read out the data using GetAlias() on a returned object. Alias is useful for adding calculations or subqueries to the query.
func (*LoginsBuilder) Count ¶
func (b *LoginsBuilder) Count(distinct bool, nodes ...query.NodeI) uint
Count terminates a query and returns just the number of items selected.
distinct wll count the number of distinct items, ignoring duplicates.
nodes will select individual fields, and should be accompanied by a GroupBy.
func (*LoginsBuilder) Delete ¶
func (b *LoginsBuilder) Delete()
Delete uses the query builder to delete a group of records that match the criteria
func (*LoginsBuilder) Distinct ¶
func (b *LoginsBuilder) Distinct() *LoginsBuilder
Distinct removes duplicates from the results of the query. Adding a Select() may help you get to the data you want, although using Distinct with joined tables is often not effective, since we force joined tables to include primary keys in the query, and this often ruins the effect of Distinct.
func (*LoginsBuilder) Expand ¶
func (b *LoginsBuilder) Expand(n query.NodeI) *LoginsBuilder
Expand expands an array type node so that it will produce individual rows instead of an array of items
func (*LoginsBuilder) Get ¶
func (b *LoginsBuilder) Get() *Login
Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items.
func (*LoginsBuilder) GroupBy ¶
func (b *LoginsBuilder) GroupBy(nodes ...query.NodeI) *LoginsBuilder
GroupBy controls how results are grouped when using aggregate functions in an Alias() call.
func (*LoginsBuilder) Having ¶
func (b *LoginsBuilder) Having(node query.NodeI) *LoginsBuilder
Having does additional filtering on the results of the query.
func (*LoginsBuilder) Join ¶
func (b *LoginsBuilder) Join(n query.NodeI, conditions ...query.NodeI) *LoginsBuilder
Join adds a node to the node tree so that its fields will appear in the query. Optionally add conditions to filter what gets included. The conditions will be AND'd with the basic condition matching the primary keys of the join.
func (*LoginsBuilder) Limit ¶
func (b *LoginsBuilder) Limit(maxRowCount int, offset int) *LoginsBuilder
Limit will return a subset of the data, limited to the offset and number of rows specified
func (*LoginsBuilder) Load ¶
func (b *LoginsBuilder) Load() (loginSlice []*Login)
Load terminates the query builder, performs the query, and returns a slice of Login objects. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice
func (*LoginsBuilder) LoadCursor ¶ added in v0.19.2
func (b *LoginsBuilder) LoadCursor() loginCursor
LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.
A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.
Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use
defer cursor.Close()
to make sure the cursor gets closed.
func (*LoginsBuilder) LoadI ¶
func (b *LoginsBuilder) LoadI() (loginSlice []interface{})
LoadI terminates the query builder, performs the query, and returns a slice of interfaces. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice.
func (*LoginsBuilder) OrderBy ¶
func (b *LoginsBuilder) OrderBy(nodes ...query.NodeI) *LoginsBuilder
OrderBy specifies how the resulting data should be sorted.
func (*LoginsBuilder) Select ¶
func (b *LoginsBuilder) Select(nodes ...query.NodeI) *LoginsBuilder
Select optimizes the query to only return the specified fields. Once you put a Select in your query, you must specify all the fields that you will eventually read out. Be careful when selecting fields in joined tables, as joined tables will also contain pointers back to the parent table, and so the parent node should have the same field selected as the child node if you are querying those fields.
func (*LoginsBuilder) Subquery ¶
func (b *LoginsBuilder) Subquery() *query.SubqueryNode
Subquery uses the query builder to define a subquery within a larger query. You MUST include what you are selecting by adding Alias or Select functions on the subquery builder. Generally you would use this as a node to an Alias function on the surrounding query builder.
func (*LoginsBuilder) Where ¶
func (b *LoginsBuilder) Where(c query.NodeI) *LoginsBuilder
Where adds a condition to filter what gets selected.
type Milestone ¶
type Milestone struct {
// contains filtered or unexported fields
}
func LoadMilestone ¶
func LoadMilestone(ctx context.Context, primaryKey string, joinOrSelectNodes ...query.NodeI) *Milestone
LoadMilestone returns a Milestone from the database. joinOrSelectNodes lets you provide nodes for joining to other tables or selecting specific fields. Table nodes will be considered Join nodes, and column nodes will be Select nodes. See MilestonesBuilder.Join and MilestonesBuilder.Select for more info.
func NewMilestone ¶
func NewMilestone() *Milestone
NewMilestone creates a new Milestone object and initializes it to default values.
func (*Milestone) Copy ¶ added in v0.27.2
func (o *Milestone) Copy() (newObject *Milestone)
Copy copies all valid fields (except for the primary key) to a new Milestone object. Forward reference ids will be copied, but reverse and many-many references will not. Call Save() on the new object to save it into the database.
func (*Milestone) Get ¶
func (o *Milestone) Get(key string) interface{}
Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil
func (*Milestone) GetAlias ¶
func (o *Milestone) GetAlias(key string) query.AliasValue
GetAlias returns the alias for the given key.
func (*Milestone) IDIsValid ¶
func (o *Milestone) IDIsValid() bool
IDIsValid returns true if the value was loaded from the database or has been set.
func (*Milestone) Initialize ¶
func (o *Milestone) Initialize()
Initialize will initialize or re-initialize a Milestone database object to default values.
func (*Milestone) IsDirty ¶
func (o *Milestone) IsDirty() (dirty bool)
IsDirty returns true if the object has been changed since it was read from the database.
func (*Milestone) IsNew ¶ added in v0.23.2
func (o *Milestone) IsNew() bool
IsNew returns true if the object will create a new record when saved.
func (*Milestone) LoadProject ¶
LoadProject returns the related Project. If it is not already loaded, it will attempt to load it first.
func (*Milestone) MarshalBinary ¶
MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.
func (*Milestone) MarshalJSON ¶
MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.
func (*Milestone) MarshalStringMap ¶ added in v0.15.0
func (o *Milestone) MarshalStringMap() map[string]interface{}
MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.
func (*Milestone) NameIsValid ¶
func (o *Milestone) NameIsValid() bool
NameIsValid returns true if the value was loaded from the database or has been set.
func (*Milestone) OriginalPrimaryKey ¶ added in v0.23.2
func (o *Milestone) OriginalPrimaryKey() string
OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.
func (*Milestone) PrimaryKey ¶
func (o *Milestone) PrimaryKey() string
PrimaryKey returns the current value of the primary key field.
func (*Milestone) Project ¶
func (o *Milestone) Project() *Project
Project returns the current value of the loaded Project, and nil if its not loaded.
func (*Milestone) ProjectID ¶
func (o *Milestone) ProjectID() string
ProjectID returns the loaded value of ProjectID.
func (*Milestone) ProjectIDIsValid ¶
func (o *Milestone) ProjectIDIsValid() bool
ProjectIDIsValid returns true if the value was loaded from the database or has been set.
func (*Milestone) Save ¶
Save will update or insert the object, depending on the state of the object. If it has any auto-generated ids, those will be updated.
func (*Milestone) SetName ¶
func (o *Milestone) SetName(v string)
SetName sets the value of Name in the object, to be saved later using the Save() function.
func (*Milestone) SetProject ¶
func (o *Milestone) SetProject(v *Project)
SetProject sets the value of Project in the object, to be saved later using the Save() function.
func (*Milestone) SetProjectID ¶
func (o *Milestone) SetProjectID(v string)
SetProjectID sets the value of ProjectID in the object, to be saved later using the Save() function.
func (*Milestone) String ¶
String implements the Stringer interface and returns the default label for the object as it appears in html lists. Typically you would change this to whatever was pertinent to your application.
func (*Milestone) UnmarshalBinary ¶
UnmarshalBinary converts a structure that was created with MarshalBinary into a Milestone object.
func (*Milestone) UnmarshalJSON ¶ added in v0.15.0
UnmarshalJSON unmarshalls the given json data into the milestone. The milestone can be a newly created object, or one loaded from the database.
After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.
Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.
The fields it expects are:
"id" - string "projectID" - string "name" - string
func (*Milestone) UnmarshalStringMap ¶ added in v0.15.0
UnmarshalStringMap will load the values from the stringmap into the object.
Override this in milestone to modify the json before sending it here.
type MilestonesBuilder ¶
type MilestonesBuilder struct {
// contains filtered or unexported fields
}
The MilestonesBuilder uses the QueryBuilderI interface from the database to build a query. All query operations go through this query builder. End a query by calling either Load, Count, or Delete
func QueryMilestones ¶
func QueryMilestones(ctx context.Context) *MilestonesBuilder
QueryMilestones returns a new builder that gives you general purpose access to the Milestone records in the database. Its here to give public access to the query builder, but you can remove it if you do not need it.
func (*MilestonesBuilder) Alias ¶
func (b *MilestonesBuilder) Alias(name string, n query.NodeI) *MilestonesBuilder
Alias lets you add a node with a custom name. After the query, you can read out the data using GetAlias() on a returned object. Alias is useful for adding calculations or subqueries to the query.
func (*MilestonesBuilder) Count ¶
func (b *MilestonesBuilder) Count(distinct bool, nodes ...query.NodeI) uint
Count terminates a query and returns just the number of items selected.
distinct wll count the number of distinct items, ignoring duplicates.
nodes will select individual fields, and should be accompanied by a GroupBy.
func (*MilestonesBuilder) Delete ¶
func (b *MilestonesBuilder) Delete()
Delete uses the query builder to delete a group of records that match the criteria
func (*MilestonesBuilder) Distinct ¶
func (b *MilestonesBuilder) Distinct() *MilestonesBuilder
Distinct removes duplicates from the results of the query. Adding a Select() may help you get to the data you want, although using Distinct with joined tables is often not effective, since we force joined tables to include primary keys in the query, and this often ruins the effect of Distinct.
func (*MilestonesBuilder) Expand ¶
func (b *MilestonesBuilder) Expand(n query.NodeI) *MilestonesBuilder
Expand expands an array type node so that it will produce individual rows instead of an array of items
func (*MilestonesBuilder) Get ¶
func (b *MilestonesBuilder) Get() *Milestone
Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items.
func (*MilestonesBuilder) GroupBy ¶
func (b *MilestonesBuilder) GroupBy(nodes ...query.NodeI) *MilestonesBuilder
GroupBy controls how results are grouped when using aggregate functions in an Alias() call.
func (*MilestonesBuilder) Having ¶
func (b *MilestonesBuilder) Having(node query.NodeI) *MilestonesBuilder
Having does additional filtering on the results of the query.
func (*MilestonesBuilder) Join ¶
func (b *MilestonesBuilder) Join(n query.NodeI, conditions ...query.NodeI) *MilestonesBuilder
Join adds a node to the node tree so that its fields will appear in the query. Optionally add conditions to filter what gets included. The conditions will be AND'd with the basic condition matching the primary keys of the join.
func (*MilestonesBuilder) Limit ¶
func (b *MilestonesBuilder) Limit(maxRowCount int, offset int) *MilestonesBuilder
Limit will return a subset of the data, limited to the offset and number of rows specified
func (*MilestonesBuilder) Load ¶
func (b *MilestonesBuilder) Load() (milestoneSlice []*Milestone)
Load terminates the query builder, performs the query, and returns a slice of Milestone objects. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice
func (*MilestonesBuilder) LoadCursor ¶ added in v0.19.2
func (b *MilestonesBuilder) LoadCursor() milestoneCursor
LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.
A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.
Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use
defer cursor.Close()
to make sure the cursor gets closed.
func (*MilestonesBuilder) LoadI ¶
func (b *MilestonesBuilder) LoadI() (milestoneSlice []interface{})
LoadI terminates the query builder, performs the query, and returns a slice of interfaces. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice.
func (*MilestonesBuilder) OrderBy ¶
func (b *MilestonesBuilder) OrderBy(nodes ...query.NodeI) *MilestonesBuilder
OrderBy specifies how the resulting data should be sorted.
func (*MilestonesBuilder) Select ¶
func (b *MilestonesBuilder) Select(nodes ...query.NodeI) *MilestonesBuilder
Select optimizes the query to only return the specified fields. Once you put a Select in your query, you must specify all the fields that you will eventually read out. Be careful when selecting fields in joined tables, as joined tables will also contain pointers back to the parent table, and so the parent node should have the same field selected as the child node if you are querying those fields.
func (*MilestonesBuilder) Subquery ¶
func (b *MilestonesBuilder) Subquery() *query.SubqueryNode
Subquery uses the query builder to define a subquery within a larger query. You MUST include what you are selecting by adding Alias or Select functions on the subquery builder. Generally you would use this as a node to an Alias function on the surrounding query builder.
func (*MilestonesBuilder) Where ¶
func (b *MilestonesBuilder) Where(c query.NodeI) *MilestonesBuilder
Where adds a condition to filter what gets selected.
type PeopleBuilder ¶
type PeopleBuilder struct {
// contains filtered or unexported fields
}
The PeopleBuilder uses the QueryBuilderI interface from the database to build a query. All query operations go through this query builder. End a query by calling either Load, Count, or Delete
func QueryPeople ¶
func QueryPeople(ctx context.Context) *PeopleBuilder
QueryPeople returns a new builder that gives you general purpose access to the Person records in the database. Its here to give public access to the query builder, but you can remove it if you do not need it.
func (*PeopleBuilder) Alias ¶
func (b *PeopleBuilder) Alias(name string, n query.NodeI) *PeopleBuilder
Alias lets you add a node with a custom name. After the query, you can read out the data using GetAlias() on a returned object. Alias is useful for adding calculations or subqueries to the query.
func (*PeopleBuilder) Count ¶
func (b *PeopleBuilder) Count(distinct bool, nodes ...query.NodeI) uint
Count terminates a query and returns just the number of items selected.
distinct wll count the number of distinct items, ignoring duplicates.
nodes will select individual fields, and should be accompanied by a GroupBy.
func (*PeopleBuilder) Delete ¶
func (b *PeopleBuilder) Delete()
Delete uses the query builder to delete a group of records that match the criteria
func (*PeopleBuilder) Distinct ¶
func (b *PeopleBuilder) Distinct() *PeopleBuilder
Distinct removes duplicates from the results of the query. Adding a Select() may help you get to the data you want, although using Distinct with joined tables is often not effective, since we force joined tables to include primary keys in the query, and this often ruins the effect of Distinct.
func (*PeopleBuilder) Expand ¶
func (b *PeopleBuilder) Expand(n query.NodeI) *PeopleBuilder
Expand expands an array type node so that it will produce individual rows instead of an array of items
func (*PeopleBuilder) Get ¶
func (b *PeopleBuilder) Get() *Person
Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items.
func (*PeopleBuilder) GroupBy ¶
func (b *PeopleBuilder) GroupBy(nodes ...query.NodeI) *PeopleBuilder
GroupBy controls how results are grouped when using aggregate functions in an Alias() call.
func (*PeopleBuilder) Having ¶
func (b *PeopleBuilder) Having(node query.NodeI) *PeopleBuilder
Having does additional filtering on the results of the query.
func (*PeopleBuilder) Join ¶
func (b *PeopleBuilder) Join(n query.NodeI, conditions ...query.NodeI) *PeopleBuilder
Join adds a node to the node tree so that its fields will appear in the query. Optionally add conditions to filter what gets included. The conditions will be AND'd with the basic condition matching the primary keys of the join.
func (*PeopleBuilder) Limit ¶
func (b *PeopleBuilder) Limit(maxRowCount int, offset int) *PeopleBuilder
Limit will return a subset of the data, limited to the offset and number of rows specified
func (*PeopleBuilder) Load ¶
func (b *PeopleBuilder) Load() (personSlice []*Person)
Load terminates the query builder, performs the query, and returns a slice of Person objects. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice
func (*PeopleBuilder) LoadCursor ¶ added in v0.19.2
func (b *PeopleBuilder) LoadCursor() personCursor
LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.
A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.
Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use
defer cursor.Close()
to make sure the cursor gets closed.
func (*PeopleBuilder) LoadI ¶
func (b *PeopleBuilder) LoadI() (personSlice []interface{})
LoadI terminates the query builder, performs the query, and returns a slice of interfaces. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice.
func (*PeopleBuilder) OrderBy ¶
func (b *PeopleBuilder) OrderBy(nodes ...query.NodeI) *PeopleBuilder
OrderBy specifies how the resulting data should be sorted.
func (*PeopleBuilder) Select ¶
func (b *PeopleBuilder) Select(nodes ...query.NodeI) *PeopleBuilder
Select optimizes the query to only return the specified fields. Once you put a Select in your query, you must specify all the fields that you will eventually read out. Be careful when selecting fields in joined tables, as joined tables will also contain pointers back to the parent table, and so the parent node should have the same field selected as the child node if you are querying those fields.
func (*PeopleBuilder) Subquery ¶
func (b *PeopleBuilder) Subquery() *query.SubqueryNode
Subquery uses the query builder to define a subquery within a larger query. You MUST include what you are selecting by adding Alias or Select functions on the subquery builder. Generally you would use this as a node to an Alias function on the surrounding query builder.
func (*PeopleBuilder) Where ¶
func (b *PeopleBuilder) Where(c query.NodeI) *PeopleBuilder
Where adds a condition to filter what gets selected.
type Person ¶
type Person struct {
// contains filtered or unexported fields
}
func LoadPerson ¶
LoadPerson returns a Person from the database. joinOrSelectNodes lets you provide nodes for joining to other tables or selecting specific fields. Table nodes will be considered Join nodes, and column nodes will be Select nodes. See PeopleBuilder.Join and PeopleBuilder.Select for more info.
func NewPerson ¶
func NewPerson() *Person
NewPerson creates a new Person object and initializes it to default values.
func (*Person) Address ¶
Address returns a single Address object by primary key, if one was loaded. Otherwise, it will return nil. It will not return Address objects that are not saved.
func (*Person) Addresses ¶
func (o *Person) Addresses() []*Address
Addresses returns a slice of Address objects if loaded.
func (*Person) Copy ¶ added in v0.27.2
func (o *Person) Copy() (newObject *Person)
Copy copies all valid fields (except for the primary key) to a new Person object. Forward reference ids will be copied, but reverse and many-many references will not. Call Save() on the new object to save it into the database.
func (*Person) CountAddresses ¶ added in v0.10.0
CountAddresses returns the number of Address objects in the database connected to this object.
func (*Person) CountProjects ¶ added in v0.27.5
CountProjects counts the number of associated Project objects in the database. Note that this returns what is reflected by the database at that instant, and not what is the count of the loaded objects.
func (*Person) CountProjectsAsManager ¶ added in v0.10.0
CountProjectsAsManager returns the number of Project objects in the database connected to this object.
func (*Person) EmployeeInfo ¶ added in v0.7.0
func (o *Person) EmployeeInfo() *EmployeeInfo
EmployeeInfo returns the connected EmployeeInfo object, if one was loaded. Otherwise, it will return nil.
func (*Person) FirstName ¶
func (o *Person) FirstName() string
FirstName returns the loaded value of FirstName.
func (*Person) FirstNameIsValid ¶
func (o *Person) FirstNameIsValid() bool
FirstNameIsValid returns true if the value was loaded from the database or has been set.
func (*Person) Get ¶
func (o *Person) Get(key string) interface{}
Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil
func (*Person) GetAlias ¶
func (o *Person) GetAlias(key string) query.AliasValue
GetAlias returns the alias for the given key.
func (*Person) IDIsValid ¶
func (o *Person) IDIsValid() bool
IDIsValid returns true if the value was loaded from the database or has been set.
func (*Person) Initialize ¶
func (o *Person) Initialize()
Initialize will initialize or re-initialize a Person database object to default values.
func (*Person) IsDirty ¶
func (o *Person) IsDirty() (dirty bool)
IsDirty returns true if the object has been changed since it was read from the database.
func (*Person) IsNew ¶ added in v0.23.2
func (o *Person) IsNew() bool
IsNew returns true if the object will create a new record when saved.
func (*Person) LastName ¶
func (o *Person) LastName() string
LastName returns the loaded value of LastName.
func (*Person) LastNameIsValid ¶
func (o *Person) LastNameIsValid() bool
LastNameIsValid returns true if the value was loaded from the database or has been set.
func (*Person) LoadAddresses ¶
LoadAddresses loads a new slice of Address objects and returns it.
func (*Person) LoadEmployeeInfo ¶ added in v0.7.0
func (o *Person) LoadEmployeeInfo(ctx context.Context) *EmployeeInfo
LoadEmployeeInfo returns the connected EmployeeInfo object, if one was loaded. Otherwise, it will load a new one and return it.
func (*Person) LoadLogin ¶
LoadLogin returns the connected Login object, if one was loaded. Otherwise, it will load a new one and return it.
func (*Person) LoadProjects ¶ added in v0.27.5
LoadProjects loads the associated Project objects.
func (*Person) LoadProjectsAsManager ¶
LoadProjectsAsManager loads a new slice of Project objects and returns it.
func (*Person) Login ¶
func (o *Person) Login() *Login
Login returns the connected Login object, if one was loaded. Otherwise, it will return nil.
func (*Person) MarshalBinary ¶
MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.
func (*Person) MarshalJSON ¶
MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.
func (*Person) MarshalStringMap ¶ added in v0.15.0
func (o *Person) MarshalStringMap() map[string]interface{}
MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.
func (*Person) OriginalPrimaryKey ¶ added in v0.23.2
func (o *Person) OriginalPrimaryKey() string
OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.
func (*Person) PersonTypes ¶
func (o *Person) PersonTypes() []PersonType
PersonTypes returns a slice of PersonType values if loaded.
func (*Person) PrimaryKey ¶
func (o *Person) PrimaryKey() string
PrimaryKey returns the current value of the primary key field.
func (*Person) Project ¶ added in v0.27.5
Project returns a single Project object by primary key, if one was loaded otherwise, it will return nil.
func (*Person) ProjectAsManager ¶
ProjectAsManager returns a single Project object by primary key, if one was loaded. Otherwise, it will return nil. It will not return Project objects that are not saved.
func (*Person) Projects ¶ added in v0.27.5
func (o *Person) Projects() []*Project
Projects returns a slice of Project objects if loaded. If not loaded, will return nil.
func (*Person) ProjectsAsManager ¶
func (o *Person) ProjectsAsManager() []*Project
ProjectsAsManager returns a slice of Project objects if loaded.
func (*Person) Save ¶
Save will update or insert the object, depending on the state of the object. If it has any auto-generated ids, those will be updated.
func (*Person) SetAddressPrimaryKeys ¶ added in v0.27.5
func (o *Person) SetAddressPrimaryKeys(pks []string)
SetAddressPrimaryKeys associates the given object primary keys with the Person.
The association is temporary until you call Save().
WARNING! If it has items already associated with it that will not be associated after a save, those items will be DELETED when you Save() since they cannot be null. If you did not use a join to query the items in the first place, used a conditional join, or joined with an expansion, be particularly careful, since you may be changing items that are not currently attached to this Person.
func (*Person) SetAddresses ¶ added in v0.7.0
func (o *Person) SetAddresses(objs []*Address)
SetAddresses associates the given objects with the Person. WARNING! If it has items already associated with it that will not be associated after a save, those items will be DELETED since they cannot be null. If you did not use a join to query the items in the first place, used a conditional join, or joined with an expansion, be particularly careful, since you may be changing items that are not currently attached to this Person.
func (*Person) SetEmployeeInfo ¶ added in v0.7.0
func (o *Person) SetEmployeeInfo(obj *EmployeeInfo)
SetEmployeeInfo associates the given object with the Person.
The association is temporary until you call Save(). WARNING! If it has an item already associated with it, that item will be DELETED since it cannot be null. If you did not use a join to query the items in the first place, used a conditional join, or joined with an expansion, be particularly careful, since you may be changing an item that is not currently attached to this Person.
func (*Person) SetEmployeeInfoPrimaryKey ¶ added in v0.27.5
func (o *Person) SetEmployeeInfoPrimaryKey(pk string)
SetEmployeeInfoPrimaryKey associates the given object with the Person that has the given primary key.
The association is temporary until you call Save(). If a Person was loaded, it will be unloaded.
WARNING! If it has an item already associated with it in the database, that item will be DELETED when you call Save() since it cannot be null. If you did not use a join to query the items in the first place, used a conditional join, or joined with an expansion, be particularly careful, since you may be changing an item that is not currently attached to this Person.
func (*Person) SetFirstName ¶
func (o *Person) SetFirstName(v string)
SetFirstName sets the value of FirstName in the object, to be saved later using the Save() function.
func (*Person) SetLastName ¶
func (o *Person) SetLastName(v string)
SetLastName sets the value of LastName in the object, to be saved later using the Save() function.
func (*Person) SetLogin ¶ added in v0.7.0
func (o *Person) SetLogin(obj *Login)
SetLogin associates the given object with the Person.
The association is temporary until you call Save(). If it has an item already associated with it, the foreign key for that item will be set to null. If you did not use a join to query the items in the first place, used a conditional join, or joined with an expansion, be particularly careful, since you may be changing an item that is not currently attached to this Person.
func (*Person) SetLoginPrimaryKey ¶ added in v0.27.5
func (o *Person) SetLoginPrimaryKey(pk string)
SetLoginPrimaryKey associates the given object with the Person that has the given primary key.
The association is temporary until you call Save(). If a Person was loaded, it will be unloaded.
If it has an item already associated with it in the database, the foreign key for that item will be set to null when you call Save(). If you did not use a join to query the items in the first place, used a conditional join, or joined with an expansion, be particularly careful, since you may be changing an item that is not currently attached to this Person.
func (*Person) SetPersonTypes ¶ added in v0.9.0
func (o *Person) SetPersonTypes(objs []PersonType)
SetPersonTypes sets the associated values to the given slice of PersonType values. It will also disassociate from all previously associated values.
func (*Person) SetProjectAsManagerPrimaryKeys ¶ added in v0.27.5
func (o *Person) SetProjectAsManagerPrimaryKeys(pks []string)
SetProjectAsManagerPrimaryKeys associates the given object primary keys with the Person.
The association is temporary until you call Save().
If it has items already associated with it that will not be associated after a save, the foreign keys for those will be set to null when you Save(). If you did not use a join to query the items in the first place, used a conditional join, or joined with an expansion, be particularly careful, since you may be changing items that are not currently attached to this Person.
func (*Person) SetProjectPrimaryKeys ¶ added in v0.27.5
func (o *Person) SetProjectPrimaryKeys(objs []string)
SetProjectPrimaryKeys prepares for setting the associated Project objects to the given slice of primary keys. If objects are currently loaded, they will be unloaded. The association does not take place until Save() is called. Calling Load before calling Save will load the items that will be associated in the database after the Save call. After calling Save, the objects will be unloaded, and you must call Load again if you want them loaded.
func (*Person) SetProjects ¶ added in v0.27.5
func (o *Person) SetProjects(objs []*Project)
SetProjects sets the associated objects to the given slice of Project objects in preparation for saving. The associations will not be updated until Save() is called. Objects that are modified or are new will be saved before completing the association.
func (*Person) SetProjectsAsManager ¶ added in v0.7.0
func (o *Person) SetProjectsAsManager(objs []*Project)
SetProjectsAsManager associates the given objects with the Person. If it has items already associated with it that will not be associated after a save, the foreign keys for those will be set to null. If you did not use a join to query the items in the first place, used a conditional join, or joined with an expansion, be particularly careful, since you may be changing items that are not currently attached to this Person.
func (*Person) String ¶
String implements the Stringer interface and returns the default label for the object as it appears in html lists. Typically you would change this to whatever was pertinent to your application.
func (*Person) UnmarshalBinary ¶
UnmarshalBinary converts a structure that was created with MarshalBinary into a Person object.
func (*Person) UnmarshalJSON ¶ added in v0.15.0
UnmarshalJSON unmarshalls the given json data into the person. The person can be a newly created object, or one loaded from the database.
After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.
Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.
The fields it expects are:
"id" - string "firstName" - string "lastName" - string
func (*Person) UnmarshalStringMap ¶ added in v0.15.0
UnmarshalStringMap will load the values from the stringmap into the object.
Override this in person to modify the json before sending it here.
type PersonType ¶
type PersonType int
const ( PersonTypeContractor PersonType = 1 PersonTypeManager PersonType = 2 PersonTypeInactive PersonType = 3 PersonTypeCompanyCar PersonType = 4 PersonTypeWorksFromHome PersonType = 5 )
func AllPersonTypes ¶ added in v0.9.0
func AllPersonTypes() (values []PersonType)
AllPersonTypes returns a slice of all the PersonType values.
func PersonTypeFromID ¶ added in v0.9.3
func PersonTypeFromID(id string) PersonType
PersonTypeFromID converts a PersonType ID to a PersonType
func PersonTypeFromName ¶ added in v0.15.0
func PersonTypeFromName(name string) PersonType
PersonTypeFromName converts a PersonType name to a PersonType
func PersonTypesFromIDs ¶ added in v0.27.5
func PersonTypesFromIDs(ids []string) (values []PersonType)
PersonTypesFromIDs converts a slice of PersonType IDs to a slice of PersonType
func (PersonType) Get ¶ added in v0.12.0
func (p PersonType) Get(key string) interface{}
func (PersonType) ID ¶
func (p PersonType) ID() string
ID returns a string representation of the id and satisfies the IDer interface
func (PersonType) Label ¶
func (p PersonType) Label() string
Label returns the string that will be displayed to a user for this item. Together with the Value function, it satisfies the ItemLister interface that makes it easy to create a dropdown list of items.
func (PersonType) Name ¶ added in v0.12.0
func (p PersonType) Name() string
func (PersonType) String ¶
func (p PersonType) String() string
String returns the name value of the type and satisfies the fmt.Stringer interface
func (PersonType) Value ¶
func (p PersonType) Value() interface{}
Value returns the value that will be used in dropdown lists and satisfies the Valuer and ItemLister interfaces.
type PersonWithLock ¶
type PersonWithLock struct {
// contains filtered or unexported fields
}
func LoadPersonWithLock ¶
func LoadPersonWithLock(ctx context.Context, primaryKey string, joinOrSelectNodes ...query.NodeI) *PersonWithLock
LoadPersonWithLock returns a PersonWithLock from the database. joinOrSelectNodes lets you provide nodes for joining to other tables or selecting specific fields. Table nodes will be considered Join nodes, and column nodes will be Select nodes. See PersonWithLocksBuilder.Join and PersonWithLocksBuilder.Select for more info.
func NewPersonWithLock ¶
func NewPersonWithLock() *PersonWithLock
NewPersonWithLock creates a new PersonWithLock object and initializes it to default values.
func (*PersonWithLock) Copy ¶ added in v0.27.2
func (o *PersonWithLock) Copy() (newObject *PersonWithLock)
Copy copies all valid fields (except for the primary key) to a new PersonWithLock object. Forward reference ids will be copied, but reverse and many-many references will not. Call Save() on the new object to save it into the database.
func (*PersonWithLock) FirstName ¶
func (o *PersonWithLock) FirstName() string
FirstName returns the loaded value of FirstName.
func (*PersonWithLock) FirstNameIsValid ¶
func (o *PersonWithLock) FirstNameIsValid() bool
FirstNameIsValid returns true if the value was loaded from the database or has been set.
func (*PersonWithLock) Get ¶
func (o *PersonWithLock) Get(key string) interface{}
Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil
func (*PersonWithLock) GetAlias ¶
func (o *PersonWithLock) GetAlias(key string) query.AliasValue
GetAlias returns the alias for the given key.
func (*PersonWithLock) IDIsValid ¶
func (o *PersonWithLock) IDIsValid() bool
IDIsValid returns true if the value was loaded from the database or has been set.
func (*PersonWithLock) Initialize ¶
func (o *PersonWithLock) Initialize()
Initialize will initialize or re-initialize a PersonWithLock database object to default values.
func (*PersonWithLock) IsDirty ¶
func (o *PersonWithLock) IsDirty() (dirty bool)
IsDirty returns true if the object has been changed since it was read from the database.
func (*PersonWithLock) IsNew ¶ added in v0.23.2
func (o *PersonWithLock) IsNew() bool
IsNew returns true if the object will create a new record when saved.
func (*PersonWithLock) LastName ¶
func (o *PersonWithLock) LastName() string
LastName returns the loaded value of LastName.
func (*PersonWithLock) LastNameIsValid ¶
func (o *PersonWithLock) LastNameIsValid() bool
LastNameIsValid returns true if the value was loaded from the database or has been set.
func (*PersonWithLock) MarshalBinary ¶
MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.
func (*PersonWithLock) MarshalJSON ¶
MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.
func (*PersonWithLock) MarshalStringMap ¶ added in v0.15.0
func (o *PersonWithLock) MarshalStringMap() map[string]interface{}
MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.
func (*PersonWithLock) OriginalPrimaryKey ¶ added in v0.23.2
func (o *PersonWithLock) OriginalPrimaryKey() string
OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.
func (*PersonWithLock) PrimaryKey ¶
func (o *PersonWithLock) PrimaryKey() string
PrimaryKey returns the current value of the primary key field.
func (*PersonWithLock) Save ¶
Save will update or insert the object, depending on the state of the object. If it has any auto-generated ids, those will be updated.
func (*PersonWithLock) SetFirstName ¶
func (o *PersonWithLock) SetFirstName(v string)
SetFirstName sets the value of FirstName in the object, to be saved later using the Save() function.
func (*PersonWithLock) SetLastName ¶
func (o *PersonWithLock) SetLastName(v string)
SetLastName sets the value of LastName in the object, to be saved later using the Save() function.
func (*PersonWithLock) SetSysTimestamp ¶
func (o *PersonWithLock) SetSysTimestamp(i interface{})
func (*PersonWithLock) String ¶
func (o *PersonWithLock) String() string
String implements the Stringer interface and returns the default label for the object as it appears in html lists. Typically you would change this to whatever was pertinent to your application.
func (*PersonWithLock) SysTimestamp ¶
SysTimestamp returns the loaded value of SysTimestamp.
func (*PersonWithLock) SysTimestampIsNull ¶
func (o *PersonWithLock) SysTimestampIsNull() bool
SysTimestampIsNull returns true if the related database value is null.
func (*PersonWithLock) SysTimestampIsValid ¶
func (o *PersonWithLock) SysTimestampIsValid() bool
SysTimestampIsValid returns true if the value was loaded from the database or has been set.
func (*PersonWithLock) SysTimestamp_I ¶ added in v0.12.0
func (o *PersonWithLock) SysTimestamp_I() interface{}
SysTimestamp_I returns the loaded value of SysTimestamp as an interface. If the value in the database is NULL, a nil interface is returned.
func (*PersonWithLock) UnmarshalBinary ¶
UnmarshalBinary converts a structure that was created with MarshalBinary into a PersonWithLock object.
func (*PersonWithLock) UnmarshalJSON ¶ added in v0.15.0
UnmarshalJSON unmarshalls the given json data into the personWithLock. The personWithLock can be a newly created object, or one loaded from the database.
After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.
Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.
The fields it expects are:
"id" - string "firstName" - string "lastName" - string "sysTimestamp" - time.Time, nullable
func (*PersonWithLock) UnmarshalStringMap ¶ added in v0.15.0
UnmarshalStringMap will load the values from the stringmap into the object.
Override this in personWithLock to modify the json before sending it here.
type PersonWithLocksBuilder ¶
type PersonWithLocksBuilder struct {
// contains filtered or unexported fields
}
The PersonWithLocksBuilder uses the QueryBuilderI interface from the database to build a query. All query operations go through this query builder. End a query by calling either Load, Count, or Delete
func QueryPersonWithLocks ¶
func QueryPersonWithLocks(ctx context.Context) *PersonWithLocksBuilder
QueryPersonWithLocks returns a new builder that gives you general purpose access to the PersonWithLock records in the database. Its here to give public access to the query builder, but you can remove it if you do not need it.
func (*PersonWithLocksBuilder) Alias ¶
func (b *PersonWithLocksBuilder) Alias(name string, n query.NodeI) *PersonWithLocksBuilder
Alias lets you add a node with a custom name. After the query, you can read out the data using GetAlias() on a returned object. Alias is useful for adding calculations or subqueries to the query.
func (*PersonWithLocksBuilder) Count ¶
func (b *PersonWithLocksBuilder) Count(distinct bool, nodes ...query.NodeI) uint
Count terminates a query and returns just the number of items selected.
distinct wll count the number of distinct items, ignoring duplicates.
nodes will select individual fields, and should be accompanied by a GroupBy.
func (*PersonWithLocksBuilder) Delete ¶
func (b *PersonWithLocksBuilder) Delete()
Delete uses the query builder to delete a group of records that match the criteria
func (*PersonWithLocksBuilder) Distinct ¶
func (b *PersonWithLocksBuilder) Distinct() *PersonWithLocksBuilder
Distinct removes duplicates from the results of the query. Adding a Select() may help you get to the data you want, although using Distinct with joined tables is often not effective, since we force joined tables to include primary keys in the query, and this often ruins the effect of Distinct.
func (*PersonWithLocksBuilder) Expand ¶
func (b *PersonWithLocksBuilder) Expand(n query.NodeI) *PersonWithLocksBuilder
Expand expands an array type node so that it will produce individual rows instead of an array of items
func (*PersonWithLocksBuilder) Get ¶
func (b *PersonWithLocksBuilder) Get() *PersonWithLock
Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items.
func (*PersonWithLocksBuilder) GroupBy ¶
func (b *PersonWithLocksBuilder) GroupBy(nodes ...query.NodeI) *PersonWithLocksBuilder
GroupBy controls how results are grouped when using aggregate functions in an Alias() call.
func (*PersonWithLocksBuilder) Having ¶
func (b *PersonWithLocksBuilder) Having(node query.NodeI) *PersonWithLocksBuilder
Having does additional filtering on the results of the query.
func (*PersonWithLocksBuilder) Join ¶
func (b *PersonWithLocksBuilder) Join(n query.NodeI, conditions ...query.NodeI) *PersonWithLocksBuilder
Join adds a node to the node tree so that its fields will appear in the query. Optionally add conditions to filter what gets included. The conditions will be AND'd with the basic condition matching the primary keys of the join.
func (*PersonWithLocksBuilder) Limit ¶
func (b *PersonWithLocksBuilder) Limit(maxRowCount int, offset int) *PersonWithLocksBuilder
Limit will return a subset of the data, limited to the offset and number of rows specified
func (*PersonWithLocksBuilder) Load ¶
func (b *PersonWithLocksBuilder) Load() (personWithLockSlice []*PersonWithLock)
Load terminates the query builder, performs the query, and returns a slice of PersonWithLock objects. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice
func (*PersonWithLocksBuilder) LoadCursor ¶ added in v0.19.2
func (b *PersonWithLocksBuilder) LoadCursor() personWithLockCursor
LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.
A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.
Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use
defer cursor.Close()
to make sure the cursor gets closed.
func (*PersonWithLocksBuilder) LoadI ¶
func (b *PersonWithLocksBuilder) LoadI() (personWithLockSlice []interface{})
LoadI terminates the query builder, performs the query, and returns a slice of interfaces. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice.
func (*PersonWithLocksBuilder) OrderBy ¶
func (b *PersonWithLocksBuilder) OrderBy(nodes ...query.NodeI) *PersonWithLocksBuilder
OrderBy specifies how the resulting data should be sorted.
func (*PersonWithLocksBuilder) Select ¶
func (b *PersonWithLocksBuilder) Select(nodes ...query.NodeI) *PersonWithLocksBuilder
Select optimizes the query to only return the specified fields. Once you put a Select in your query, you must specify all the fields that you will eventually read out. Be careful when selecting fields in joined tables, as joined tables will also contain pointers back to the parent table, and so the parent node should have the same field selected as the child node if you are querying those fields.
func (*PersonWithLocksBuilder) Subquery ¶
func (b *PersonWithLocksBuilder) Subquery() *query.SubqueryNode
Subquery uses the query builder to define a subquery within a larger query. You MUST include what you are selecting by adding Alias or Select functions on the subquery builder. Generally you would use this as a node to an Alias function on the surrounding query builder.
func (*PersonWithLocksBuilder) Where ¶
func (b *PersonWithLocksBuilder) Where(c query.NodeI) *PersonWithLocksBuilder
Where adds a condition to filter what gets selected.
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
func LoadProject ¶
LoadProject returns a Project from the database. joinOrSelectNodes lets you provide nodes for joining to other tables or selecting specific fields. Table nodes will be considered Join nodes, and column nodes will be Select nodes. See ProjectsBuilder.Join and ProjectsBuilder.Select for more info.
func LoadProjectByNum ¶
LoadProjectByNum queries for a single Project object by the given unique index values. joinOrSelectNodes lets you provide nodes for joining to other tables or selecting specific fields. Table nodes will be considered Join nodes, and column nodes will be Select nodes. See ProjectsBuilder.Join and ProjectsBuilder.Select for more info. If you need a more elaborate query, use QueryProjects() to start a query builder.
func NewProject ¶
func NewProject() *Project
NewProject creates a new Project object and initializes it to default values.
func (*Project) Budget ¶
func (o *Project) Budget() string
Budget returns the loaded value of Budget.
func (*Project) BudgetIsNull ¶
func (o *Project) BudgetIsNull() bool
BudgetIsNull returns true if the related database value is null.
func (*Project) BudgetIsValid ¶
func (o *Project) BudgetIsValid() bool
BudgetIsValid returns true if the value was loaded from the database or has been set.
func (*Project) Budget_I ¶ added in v0.12.0
func (o *Project) Budget_I() interface{}
Budget_I returns the loaded value of Budget as an interface. If the value in the database is NULL, a nil interface is returned.
func (*Project) Child ¶ added in v0.27.5
Child returns a single Project object by primary key, if one was loaded otherwise, it will return nil.
func (*Project) Children ¶ added in v0.27.5
func (o *Project) Children() []*Project
Children returns a slice of Project objects if loaded. If not loaded, will return nil.
func (*Project) Copy ¶ added in v0.27.2
func (o *Project) Copy() (newObject *Project)
Copy copies all valid fields (except for the primary key) to a new Project object. Forward reference ids will be copied, but reverse and many-many references will not. Call Save() on the new object to save it into the database.
func (*Project) CountChildren ¶ added in v0.27.5
CountChildren counts the number of associated Child objects in the database. Note that this returns what is reflected by the database at that instant, and not what is the count of the loaded objects.
func (*Project) CountMilestones ¶ added in v0.10.0
CountMilestones returns the number of Milestone objects in the database connected to this object.
func (*Project) CountParents ¶ added in v0.27.5
CountParents counts the number of associated Parent objects in the database. Note that this returns what is reflected by the database at that instant, and not what is the count of the loaded objects.
func (*Project) CountTeamMembers ¶ added in v0.27.0
CountTeamMembers counts the number of associated TeamMember objects in the database. Note that this returns what is reflected by the database at that instant, and not what is the count of the loaded objects.
func (*Project) Description ¶
func (o *Project) Description() string
Description returns the loaded value of Description.
func (*Project) DescriptionIsNull ¶
func (o *Project) DescriptionIsNull() bool
DescriptionIsNull returns true if the related database value is null.
func (*Project) DescriptionIsValid ¶
func (o *Project) DescriptionIsValid() bool
DescriptionIsValid returns true if the value was loaded from the database or has been set.
func (*Project) Description_I ¶ added in v0.12.0
func (o *Project) Description_I() interface{}
Description_I returns the loaded value of Description as an interface. If the value in the database is NULL, a nil interface is returned.
func (*Project) EndDateIsNull ¶
func (o *Project) EndDateIsNull() bool
EndDateIsNull returns true if the related database value is null.
func (*Project) EndDateIsValid ¶
func (o *Project) EndDateIsValid() bool
EndDateIsValid returns true if the value was loaded from the database or has been set.
func (*Project) EndDate_I ¶ added in v0.12.0
func (o *Project) EndDate_I() interface{}
EndDate_I returns the loaded value of EndDate as an interface. If the value in the database is NULL, a nil interface is returned.
func (*Project) Get ¶
func (o *Project) Get(key string) interface{}
Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil
func (*Project) GetAlias ¶
func (o *Project) GetAlias(key string) query.AliasValue
GetAlias returns the alias for the given key.
func (*Project) IDIsValid ¶
func (o *Project) IDIsValid() bool
IDIsValid returns true if the value was loaded from the database or has been set.
func (*Project) Initialize ¶
func (o *Project) Initialize()
Initialize will initialize or re-initialize a Project database object to default values.
func (*Project) IsDirty ¶
func (o *Project) IsDirty() (dirty bool)
IsDirty returns true if the object has been changed since it was read from the database.
func (*Project) IsNew ¶ added in v0.23.2
func (o *Project) IsNew() bool
IsNew returns true if the object will create a new record when saved.
func (*Project) LoadChildren ¶ added in v0.27.5
LoadChildren loads the associated Project objects.
func (*Project) LoadManager ¶
LoadManager returns the related Manager. If it is not already loaded, it will attempt to load it first.
func (*Project) LoadMilestones ¶
LoadMilestones loads a new slice of Milestone objects and returns it.
func (*Project) LoadParents ¶ added in v0.27.5
LoadParents loads the associated Project objects.
func (*Project) LoadTeamMembers ¶ added in v0.26.0
LoadTeamMembers loads the associated Person objects.
func (*Project) Manager ¶
func (o *Project) Manager() *Person
Manager returns the current value of the loaded Manager, and nil if its not loaded.
func (*Project) ManagerID ¶
func (o *Project) ManagerID() string
ManagerID returns the loaded value of ManagerID.
func (*Project) ManagerIDIsNull ¶
func (o *Project) ManagerIDIsNull() bool
ManagerIDIsNull returns true if the related database value is null.
func (*Project) ManagerIDIsValid ¶
func (o *Project) ManagerIDIsValid() bool
ManagerIDIsValid returns true if the value was loaded from the database or has been set.
func (*Project) ManagerID_I ¶ added in v0.12.0
func (o *Project) ManagerID_I() interface{}
ManagerID_I returns the loaded value of ManagerID as an interface. If the value in the database is NULL, a nil interface is returned.
func (*Project) MarshalBinary ¶
MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.
func (*Project) MarshalJSON ¶
MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.
func (*Project) MarshalStringMap ¶ added in v0.15.0
func (o *Project) MarshalStringMap() map[string]interface{}
MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.
func (*Project) Milestone ¶
Milestone returns a single Milestone object by primary key, if one was loaded. Otherwise, it will return nil. It will not return Milestone objects that are not saved.
func (*Project) Milestones ¶
func (o *Project) Milestones() []*Milestone
Milestones returns a slice of Milestone objects if loaded.
func (*Project) NameIsValid ¶
func (o *Project) NameIsValid() bool
NameIsValid returns true if the value was loaded from the database or has been set.
func (*Project) NumIsValid ¶
func (o *Project) NumIsValid() bool
NumIsValid returns true if the value was loaded from the database or has been set.
func (*Project) OriginalPrimaryKey ¶ added in v0.23.2
func (o *Project) OriginalPrimaryKey() string
OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.
func (*Project) Parent ¶ added in v0.27.5
Parent returns a single Project object by primary key, if one was loaded otherwise, it will return nil.
func (*Project) Parents ¶ added in v0.27.5
func (o *Project) Parents() []*Project
Parents returns a slice of Project objects if loaded. If not loaded, will return nil.
func (*Project) PrimaryKey ¶
func (o *Project) PrimaryKey() string
PrimaryKey returns the current value of the primary key field.
func (*Project) Save ¶
Save will update or insert the object, depending on the state of the object. If it has any auto-generated ids, those will be updated.
func (*Project) SetChildPrimaryKeys ¶ added in v0.27.5
func (o *Project) SetChildPrimaryKeys(objs []string)
SetChildPrimaryKeys prepares for setting the associated Project objects to the given slice of primary keys. If objects are currently loaded, they will be unloaded. The association does not take place until Save() is called. Calling Load before calling Save will load the items that will be associated in the database after the Save call. After calling Save, the objects will be unloaded, and you must call Load again if you want them loaded.
func (*Project) SetChildren ¶ added in v0.27.5
func (o *Project) SetChildren(objs []*Project)
SetChildren sets the associated objects to the given slice of Project objects in preparation for saving. The associations will not be updated until Save() is called. Objects that are modified or are new will be saved before completing the association.
func (*Project) SetDescription ¶
func (o *Project) SetDescription(i interface{})
func (*Project) SetEndDate ¶
func (o *Project) SetEndDate(i interface{})
func (*Project) SetManager ¶
func (o *Project) SetManager(v *Person)
func (*Project) SetManagerID ¶
func (o *Project) SetManagerID(i interface{})
func (*Project) SetMilestonePrimaryKeys ¶ added in v0.27.5
func (o *Project) SetMilestonePrimaryKeys(pks []string)
SetMilestonePrimaryKeys associates the given object primary keys with the Project.
The association is temporary until you call Save().
WARNING! If it has items already associated with it that will not be associated after a save, those items will be DELETED when you Save() since they cannot be null. If you did not use a join to query the items in the first place, used a conditional join, or joined with an expansion, be particularly careful, since you may be changing items that are not currently attached to this Project.
func (*Project) SetMilestones ¶ added in v0.7.0
func (o *Project) SetMilestones(objs []*Milestone)
SetMilestones associates the given objects with the Project. WARNING! If it has items already associated with it that will not be associated after a save, those items will be DELETED since they cannot be null. If you did not use a join to query the items in the first place, used a conditional join, or joined with an expansion, be particularly careful, since you may be changing items that are not currently attached to this Project.
func (*Project) SetName ¶
func (o *Project) SetName(v string)
SetName sets the value of Name in the object, to be saved later using the Save() function.
func (*Project) SetNum ¶
func (o *Project) SetNum(v int)
SetNum sets the value of Num in the object, to be saved later using the Save() function.
func (*Project) SetParentPrimaryKeys ¶ added in v0.27.5
func (o *Project) SetParentPrimaryKeys(objs []string)
SetParentPrimaryKeys prepares for setting the associated Project objects to the given slice of primary keys. If objects are currently loaded, they will be unloaded. The association does not take place until Save() is called. Calling Load before calling Save will load the items that will be associated in the database after the Save call. After calling Save, the objects will be unloaded, and you must call Load again if you want them loaded.
func (*Project) SetParents ¶ added in v0.27.5
func (o *Project) SetParents(objs []*Project)
SetParents sets the associated objects to the given slice of Project objects in preparation for saving. The associations will not be updated until Save() is called. Objects that are modified or are new will be saved before completing the association.
func (*Project) SetStartDate ¶
func (o *Project) SetStartDate(i interface{})
func (*Project) SetStatus ¶ added in v0.27.0
func (o *Project) SetStatus(v ProjectStatus)
func (*Project) SetTeamMemberPrimaryKeys ¶ added in v0.27.5
func (o *Project) SetTeamMemberPrimaryKeys(objs []string)
SetTeamMemberPrimaryKeys prepares for setting the associated Person objects to the given slice of primary keys. If objects are currently loaded, they will be unloaded. The association does not take place until Save() is called. Calling Load before calling Save will load the items that will be associated in the database after the Save call. After calling Save, the objects will be unloaded, and you must call Load again if you want them loaded.
func (*Project) SetTeamMembers ¶ added in v0.9.0
func (o *Project) SetTeamMembers(objs []*Person)
SetTeamMembers sets the associated objects to the given slice of Person objects in preparation for saving. The associations will not be updated until Save() is called. Objects that are modified or are new will be saved before completing the association.
func (*Project) SpentIsNull ¶
func (o *Project) SpentIsNull() bool
SpentIsNull returns true if the related database value is null.
func (*Project) SpentIsValid ¶
func (o *Project) SpentIsValid() bool
SpentIsValid returns true if the value was loaded from the database or has been set.
func (*Project) Spent_I ¶ added in v0.12.0
func (o *Project) Spent_I() interface{}
Spent_I returns the loaded value of Spent as an interface. If the value in the database is NULL, a nil interface is returned.
func (*Project) StartDateIsNull ¶
func (o *Project) StartDateIsNull() bool
StartDateIsNull returns true if the related database value is null.
func (*Project) StartDateIsValid ¶
func (o *Project) StartDateIsValid() bool
StartDateIsValid returns true if the value was loaded from the database or has been set.
func (*Project) StartDate_I ¶ added in v0.12.0
func (o *Project) StartDate_I() interface{}
StartDate_I returns the loaded value of StartDate as an interface. If the value in the database is NULL, a nil interface is returned.
func (*Project) Status ¶ added in v0.27.0
func (o *Project) Status() ProjectStatus
func (*Project) String ¶
String implements the Stringer interface and returns the default label for the object as it appears in html lists. Typically you would change this to whatever was pertinent to your application.
func (*Project) TeamMember ¶
TeamMember returns a single Person object by primary key, if one was loaded otherwise, it will return nil.
func (*Project) TeamMembers ¶
func (o *Project) TeamMembers() []*Person
TeamMembers returns a slice of Person objects if loaded. If not loaded, will return nil.
func (*Project) UnmarshalBinary ¶
UnmarshalBinary converts a structure that was created with MarshalBinary into a Project object.
func (*Project) UnmarshalJSON ¶ added in v0.15.0
UnmarshalJSON unmarshalls the given json data into the project. The project can be a newly created object, or one loaded from the database.
After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.
Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.
The fields it expects are:
"id" - string "num" - int "statusID" - uint "managerID" - string, nullable "name" - string "description" - string, nullable "startDate" - time.Time, nullable "endDate" - time.Time, nullable "budget" - string, nullable "spent" - string, nullable
func (*Project) UnmarshalStringMap ¶ added in v0.15.0
UnmarshalStringMap will load the values from the stringmap into the object.
Override this in project to modify the json before sending it here.
type ProjectStatus ¶ added in v0.27.0
type ProjectStatus int
const ( ProjectStatusOpen ProjectStatus = 1 ProjectStatusCancelled ProjectStatus = 2 ProjectStatusCompleted ProjectStatus = 3 ProjectStatusPlanned ProjectStatus = 4 )
func AllProjectStatuses ¶ added in v0.27.0
func AllProjectStatuses() (values []ProjectStatus)
AllProjectStatuses returns a slice of all the ProjectStatus values.
func ProjectStatusFromID ¶ added in v0.27.0
func ProjectStatusFromID(id string) ProjectStatus
ProjectStatusFromID converts a ProjectStatus ID to a ProjectStatus
func ProjectStatusFromName ¶ added in v0.27.0
func ProjectStatusFromName(name string) ProjectStatus
ProjectStatusFromName converts a ProjectStatus name to a ProjectStatus
func ProjectStatusesFromIDs ¶ added in v0.27.5
func ProjectStatusesFromIDs(ids []string) (values []ProjectStatus)
ProjectStatusesFromIDs converts a slice of ProjectStatus IDs to a slice of ProjectStatus
func (ProjectStatus) Description ¶ added in v0.27.0
func (p ProjectStatus) Description() string
func (ProjectStatus) Get ¶ added in v0.27.0
func (p ProjectStatus) Get(key string) interface{}
func (ProjectStatus) Guidelines ¶ added in v0.27.0
func (p ProjectStatus) Guidelines() string
func (ProjectStatus) ID ¶ added in v0.27.0
func (p ProjectStatus) ID() string
ID returns a string representation of the id and satisfies the IDer interface
func (ProjectStatus) IsActive ¶ added in v0.27.0
func (p ProjectStatus) IsActive() bool
func (ProjectStatus) Label ¶ added in v0.27.0
func (p ProjectStatus) Label() string
Label returns the string that will be displayed to a user for this item. Together with the Value function, it satisfies the ItemLister interface that makes it easy to create a dropdown list of items.
func (ProjectStatus) Name ¶ added in v0.27.0
func (p ProjectStatus) Name() string
func (ProjectStatus) String ¶ added in v0.27.0
func (p ProjectStatus) String() string
String returns the name value of the type and satisfies the fmt.Stringer interface
func (ProjectStatus) Value ¶ added in v0.27.0
func (p ProjectStatus) Value() interface{}
Value returns the value that will be used in dropdown lists and satisfies the Valuer and ItemLister interfaces.
type ProjectsBuilder ¶
type ProjectsBuilder struct {
// contains filtered or unexported fields
}
The ProjectsBuilder uses the QueryBuilderI interface from the database to build a query. All query operations go through this query builder. End a query by calling either Load, Count, or Delete
func QueryProjects ¶
func QueryProjects(ctx context.Context) *ProjectsBuilder
QueryProjects returns a new builder that gives you general purpose access to the Project records in the database. Its here to give public access to the query builder, but you can remove it if you do not need it.
func (*ProjectsBuilder) Alias ¶
func (b *ProjectsBuilder) Alias(name string, n query.NodeI) *ProjectsBuilder
Alias lets you add a node with a custom name. After the query, you can read out the data using GetAlias() on a returned object. Alias is useful for adding calculations or subqueries to the query.
func (*ProjectsBuilder) Count ¶
func (b *ProjectsBuilder) Count(distinct bool, nodes ...query.NodeI) uint
Count terminates a query and returns just the number of items selected.
distinct wll count the number of distinct items, ignoring duplicates.
nodes will select individual fields, and should be accompanied by a GroupBy.
func (*ProjectsBuilder) Delete ¶
func (b *ProjectsBuilder) Delete()
Delete uses the query builder to delete a group of records that match the criteria
func (*ProjectsBuilder) Distinct ¶
func (b *ProjectsBuilder) Distinct() *ProjectsBuilder
Distinct removes duplicates from the results of the query. Adding a Select() may help you get to the data you want, although using Distinct with joined tables is often not effective, since we force joined tables to include primary keys in the query, and this often ruins the effect of Distinct.
func (*ProjectsBuilder) Expand ¶
func (b *ProjectsBuilder) Expand(n query.NodeI) *ProjectsBuilder
Expand expands an array type node so that it will produce individual rows instead of an array of items
func (*ProjectsBuilder) Get ¶
func (b *ProjectsBuilder) Get() *Project
Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items.
func (*ProjectsBuilder) GroupBy ¶
func (b *ProjectsBuilder) GroupBy(nodes ...query.NodeI) *ProjectsBuilder
GroupBy controls how results are grouped when using aggregate functions in an Alias() call.
func (*ProjectsBuilder) Having ¶
func (b *ProjectsBuilder) Having(node query.NodeI) *ProjectsBuilder
Having does additional filtering on the results of the query.
func (*ProjectsBuilder) Join ¶
func (b *ProjectsBuilder) Join(n query.NodeI, conditions ...query.NodeI) *ProjectsBuilder
Join adds a node to the node tree so that its fields will appear in the query. Optionally add conditions to filter what gets included. The conditions will be AND'd with the basic condition matching the primary keys of the join.
func (*ProjectsBuilder) Limit ¶
func (b *ProjectsBuilder) Limit(maxRowCount int, offset int) *ProjectsBuilder
Limit will return a subset of the data, limited to the offset and number of rows specified
func (*ProjectsBuilder) Load ¶
func (b *ProjectsBuilder) Load() (projectSlice []*Project)
Load terminates the query builder, performs the query, and returns a slice of Project objects. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice
func (*ProjectsBuilder) LoadCursor ¶ added in v0.19.2
func (b *ProjectsBuilder) LoadCursor() projectCursor
LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.
A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.
Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use
defer cursor.Close()
to make sure the cursor gets closed.
func (*ProjectsBuilder) LoadI ¶
func (b *ProjectsBuilder) LoadI() (projectSlice []interface{})
LoadI terminates the query builder, performs the query, and returns a slice of interfaces. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice.
func (*ProjectsBuilder) OrderBy ¶
func (b *ProjectsBuilder) OrderBy(nodes ...query.NodeI) *ProjectsBuilder
OrderBy specifies how the resulting data should be sorted.
func (*ProjectsBuilder) Select ¶
func (b *ProjectsBuilder) Select(nodes ...query.NodeI) *ProjectsBuilder
Select optimizes the query to only return the specified fields. Once you put a Select in your query, you must specify all the fields that you will eventually read out. Be careful when selecting fields in joined tables, as joined tables will also contain pointers back to the parent table, and so the parent node should have the same field selected as the child node if you are querying those fields.
func (*ProjectsBuilder) Subquery ¶
func (b *ProjectsBuilder) Subquery() *query.SubqueryNode
Subquery uses the query builder to define a subquery within a larger query. You MUST include what you are selecting by adding Alias or Select functions on the subquery builder. Generally you would use this as a node to an Alias function on the surrounding query builder.
func (*ProjectsBuilder) Where ¶
func (b *ProjectsBuilder) Where(c query.NodeI) *ProjectsBuilder
Where adds a condition to filter what gets selected.