model

package
v0.17.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddressIDDefault       = ""
	AddressPersonIDDefault = ""
	AddressStreetDefault   = ""
	AddressCityDefault     = ""
)
View Source
const (
	Address_ID       = `ID`
	Address_PersonID = `PersonID`
	Address_Person   = `Person`
	Address_Street   = `Street`
	Address_City     = `City`
)
View Source
const (
	EmployeeInfoIDDefault             = ""
	EmployeeInfoPersonIDDefault       = ""
	EmployeeInfoEmployeeNumberDefault = 0
)
View Source
const (
	EmployeeInfo_ID             = `ID`
	EmployeeInfo_PersonID       = `PersonID`
	EmployeeInfo_Person         = `Person`
	EmployeeInfo_EmployeeNumber = `EmployeeNumber`
)
View Source
const (
	GiftNumberDefault = 0
	GiftNameDefault   = ""
)
View Source
const (
	Gift_Number = `Number`
	Gift_Name   = `Name`
)
View Source
const (
	LoginIDDefault        = ""
	LoginPersonIDDefault  = ""
	LoginUsernameDefault  = ""
	LoginPasswordDefault  = ""
	LoginIsEnabledDefault = true
)
View Source
const (
	Login_ID        = `ID`
	Login_PersonID  = `PersonID`
	Login_Person    = `Person`
	Login_Username  = `Username`
	Login_Password  = `Password`
	Login_IsEnabled = `IsEnabled`
)
View Source
const (
	MilestoneIDDefault        = ""
	MilestoneProjectIDDefault = ""
	MilestoneNameDefault      = ""
)
View Source
const (
	Milestone_ID        = `ID`
	Milestone_ProjectID = `ProjectID`
	Milestone_Project   = `Project`
	Milestone_Name      = `Name`
)
View Source
const (
	PersonIDDefault        = ""
	PersonFirstNameDefault = ""
	PersonLastNameDefault  = ""
)
View Source
const (
	Person_ID        = `ID`
	Person_FirstName = `FirstName`
	Person_LastName  = `LastName`
	PersonAddresses  = `Addresses`

	PersonEmployeeInfo = `EmployeeInfo`

	PersonLogin                = `Login`
	PersonProjectsAsManager    = `ProjectsAsManager`
	PersonPersonType           = `PersonType`
	PersonPersonTypes          = `PersonTypes`
	PersonProjectAsTeamMember  = `ProjectAsTeamMember`
	PersonProjectsAsTeamMember = `ProjectsAsTeamMember`
)
View Source
const (
	PersonWithLockIDDefault           = ""
	PersonWithLockFirstNameDefault    = ""
	PersonWithLockLastNameDefault     = ""
	PersonWithLockSysTimestampDefault = datetime.Zero
)
View Source
const (
	PersonWithLock_ID           = `ID`
	PersonWithLock_FirstName    = `FirstName`
	PersonWithLock_LastName     = `LastName`
	PersonWithLock_SysTimestamp = `SysTimestamp`
)
View Source
const (
	ProjectIDDefault                  = ""
	ProjectNumDefault                 = 0
	ProjectProjectStatusTypeIDDefault = 0
	ProjectManagerIDDefault           = ""
	ProjectNameDefault                = ""
	ProjectDescriptionDefault         = ""
	ProjectStartDateDefault           = datetime.Zero
	ProjectEndDateDefault             = datetime.Zero
	ProjectBudgetDefault              = ""
	ProjectSpentDefault               = ""
)
View Source
const (
	Project_ID                  = `ID`
	Project_Num                 = `Num`
	Project_ProjectStatusTypeID = `ProjectStatusTypeID`
	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`
	ProjectChildAsParent        = `ChildAsParent`
	ProjectChildrenAsParent     = `ChildrenAsParent`
	ProjectParentAsChild        = `ParentAsChild`
	ProjectParentsAsChild       = `ParentsAsChild`
	ProjectTeamMember           = `TeamMember`
	ProjectTeamMembers          = `TeamMembers`
)
View Source
const PersonTypeMaxValue = 5
View Source
const ProjectStatusTypeMaxValue = 4

Variables

This section is empty.

Functions

func AllPersonTypesI added in v0.9.0

func AllPersonTypesI() (values []interface{})

AllPersonTypesI returns a slice of interfaces that contains all the PersonType items

func AllProjectStatusTypesI added in v0.9.0

func AllProjectStatusTypesI() (values []interface{})

AllProjectStatusTypesI returns a slice of interfaces that contains all the ProjectStatusType items

func CountAddressByCity

func CountAddressByCity(ctx context.Context, city string) uint

func CountAddressByID

func CountAddressByID(ctx context.Context, id string) uint

func CountAddressByPersonID

func CountAddressByPersonID(ctx context.Context, personID string) uint

func CountAddressByStreet

func CountAddressByStreet(ctx context.Context, street string) uint

func CountEmployeeInfoByEmployeeNumber added in v0.7.0

func CountEmployeeInfoByEmployeeNumber(ctx context.Context, employeeNumber int) uint

func CountEmployeeInfoByID added in v0.7.0

func CountEmployeeInfoByID(ctx context.Context, id string) uint

func CountEmployeeInfoByPersonID added in v0.7.0

func CountEmployeeInfoByPersonID(ctx context.Context, personID string) uint

func CountGiftByName added in v0.13.9

func CountGiftByName(ctx context.Context, name string) uint

func CountGiftByNumber added in v0.13.9

func CountGiftByNumber(ctx context.Context, number int) uint

func CountLoginByID

func CountLoginByID(ctx context.Context, id string) uint

func CountLoginByIsEnabled

func CountLoginByIsEnabled(ctx context.Context, isEnabled bool) uint

func CountLoginByPassword

func CountLoginByPassword(ctx context.Context, password string) uint

func CountLoginByPersonID

func CountLoginByPersonID(ctx context.Context, personID string) uint

func CountLoginByUsername

func CountLoginByUsername(ctx context.Context, username string) uint

func CountMilestoneByID

func CountMilestoneByID(ctx context.Context, id string) uint

func CountMilestoneByName

func CountMilestoneByName(ctx context.Context, name string) uint

func CountMilestoneByProjectID

func CountMilestoneByProjectID(ctx context.Context, projectID string) uint

func CountPersonByFirstName

func CountPersonByFirstName(ctx context.Context, firstName string) uint

func CountPersonByID

func CountPersonByID(ctx context.Context, id string) uint

func CountPersonByLastName

func CountPersonByLastName(ctx context.Context, lastName string) uint

func CountPersonWithLockByFirstName

func CountPersonWithLockByFirstName(ctx context.Context, firstName string) uint

func CountPersonWithLockByID

func CountPersonWithLockByID(ctx context.Context, id string) uint

func CountPersonWithLockByLastName

func CountPersonWithLockByLastName(ctx context.Context, lastName string) uint

func CountPersonWithLockBySysTimestamp

func CountPersonWithLockBySysTimestamp(ctx context.Context, sysTimestamp datetime.DateTime) uint

func CountProjectByBudget

func CountProjectByBudget(ctx context.Context, budget string) uint

func CountProjectByDescription

func CountProjectByDescription(ctx context.Context, description string) uint

func CountProjectByEndDate

func CountProjectByEndDate(ctx context.Context, endDate datetime.DateTime) uint

func CountProjectByID

func CountProjectByID(ctx context.Context, id string) uint

func CountProjectByManagerID

func CountProjectByManagerID(ctx context.Context, managerID string) uint

func CountProjectByName

func CountProjectByName(ctx context.Context, name string) uint

func CountProjectByNum

func CountProjectByNum(ctx context.Context, num int) uint

func CountProjectByProjectStatusTypeID

func CountProjectByProjectStatusTypeID(ctx context.Context, projectStatusTypeID uint) uint

func CountProjectBySpent

func CountProjectBySpent(ctx context.Context, spent string) uint

func CountProjectByStartDate

func CountProjectByStartDate(ctx context.Context, startDate datetime.DateTime) uint

func Database added in v0.9.0

func Database() db.DatabaseI

func DeleteAddress

func DeleteAddress(ctx context.Context, pk string)

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

func DeleteEmployeeInfo(ctx context.Context, pk string)

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

func DeleteGift(ctx context.Context, pk int)

DeleteGift deletes the given record from the database. Note that you can also delete loaded Gift objects by calling Delete on them.

func DeleteLogin

func DeleteLogin(ctx context.Context, pk string)

DeleteLogin deletes the given record from the database. Note that you can also delete loaded Login objects by calling Delete on them.

func DeleteMilestone

func DeleteMilestone(ctx context.Context, pk string)

DeleteMilestone deletes the given record from the database. Note that you can also delete loaded Milestone objects by calling Delete on them.

func DeletePerson

func DeletePerson(ctx context.Context, pk string)

DeletePerson deletes the given record from the database. Note that you can also delete loaded Person objects by calling Delete on them.

func DeletePersonWithLock

func DeletePersonWithLock(ctx context.Context, pk string)

DeletePersonWithLock deletes the given record from the database. Note that you can also delete loaded PersonWithLock objects by calling Delete on them.

func DeleteProject

func DeleteProject(ctx context.Context, pk string)

DeleteProject deletes the given record from the database. Note that you can also delete loaded Project objects by calling Delete on them.

func HasAddressByID added in v0.10.0

func HasAddressByID(ctx context.Context, id string) bool

HasAddressByID returns true if the given unique index values exist in the database.

func HasEmployeeInfoByID added in v0.10.0

func HasEmployeeInfoByID(ctx context.Context, id string) bool

HasEmployeeInfoByID returns true if the given unique index values exist in the database.

func HasEmployeeInfoByPersonID added in v0.9.3

func HasEmployeeInfoByPersonID(ctx context.Context, personID string) bool

HasEmployeeInfoByPersonID returns true if the given unique index values exist in the database.

func HasGiftByNumber added in v0.13.9

func HasGiftByNumber(ctx context.Context, number int) bool

HasGiftByNumber returns true if the given unique index values exist in the database.

func HasLoginByID added in v0.10.0

func HasLoginByID(ctx context.Context, id string) bool

HasLoginByID returns true if the given unique index values exist in the database.

func HasLoginByPersonID added in v0.9.3

func HasLoginByPersonID(ctx context.Context, personID interface{}) bool

HasLoginByPersonID returns true if the given unique index values exist in the database.

func HasLoginByUsername added in v0.9.3

func HasLoginByUsername(ctx context.Context, username string) bool

HasLoginByUsername returns true if the given unique index values exist in the database.

func HasMilestoneByID added in v0.10.0

func HasMilestoneByID(ctx context.Context, id string) bool

HasMilestoneByID returns true if the given unique index values exist in the database.

func HasPersonByID added in v0.10.0

func HasPersonByID(ctx context.Context, id string) bool

HasPersonByID returns true if the given unique index values exist in the database.

func HasPersonWithLockByID added in v0.10.0

func HasPersonWithLockByID(ctx context.Context, id string) bool

HasPersonWithLockByID returns true if the given unique index values exist in the database.

func HasProjectByID added in v0.10.0

func HasProjectByID(ctx context.Context, id string) bool

HasProjectByID returns true if the given unique index values exist in the database.

func HasProjectByNum added in v0.9.3

func HasProjectByNum(ctx context.Context, num int) bool

HasProjectByNum returns true if the given unique index values exist in the database.

func PersonTypeNames

func PersonTypeNames() []string

func ProjectStatusTypeDescriptions

func ProjectStatusTypeDescriptions() []string

func ProjectStatusTypeGuidelines

func ProjectStatusTypeGuidelines() []string

func ProjectStatusTypeIsActives

func ProjectStatusTypeIsActives() []bool

func ProjectStatusTypeNames

func ProjectStatusTypeNames() []string

Types

type Address

type Address struct {
	// contains filtered or unexported fields
}

func LoadAddress

func LoadAddress(ctx context.Context, primaryKey string, joinOrSelectNodes ...query.NodeI) *Address

Load 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 Join() and Select() for more info.

func LoadAddressByID added in v0.10.0

func LoadAddressByID(ctx context.Context, id string, joinOrSelectNodes ...query.NodeI) *Address

LoadAddressByID queries for a single Address 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 Join() and Select() for more info. If you need a more elaborate query, use QueryAddresses() to start a query builder.

func NewAddress

func NewAddress() *Address

Create a new Address object and initialize to default values.

func (*Address) City

func (o *Address) City() string

City returns the loaded value of City.

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) Delete

func (o *Address) Delete(ctx context.Context)

Delete deletes the associated record from 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) ID

func (o *Address) ID() string

ID returns the loaded value of ID.

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 or re-initialize a Address database object to default values.

func (*Address) IsDirty

func (o *Address) IsDirty() bool

func (*Address) LoadPerson

func (o *Address) LoadPerson(ctx context.Context) *Person

LoadPerson returns the related Person. If it is not already loaded, it will attempt to load it first.

func (*Address) MarshalBinary

func (o *Address) MarshalBinary() ([]byte, error)

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

func (o *Address) MarshalJSON() (data []byte, err error)

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) 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

func (*Address) Save

func (o *Address) Save(ctx context.Context)

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) SetCity

func (o *Address) SetCity(i interface{})

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

func (o *Address) 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 (*Address) UnmarshalBinary

func (o *Address) UnmarshalBinary(data []byte) (err error)

func (*Address) UnmarshalJSON added in v0.15.0

func (o *Address) UnmarshalJSON(data []byte) (err error)

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

func (o *Address) UnmarshalStringMap(m map[string]interface{}) (err error)

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

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) 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

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

Load 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 Join() and Select() for more info.

func LoadEmployeeInfoByID added in v0.10.0

func LoadEmployeeInfoByID(ctx context.Context, id string, joinOrSelectNodes ...query.NodeI) *EmployeeInfo

LoadEmployeeInfoByID 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 Join() and Select() for more info. If you need a more elaborate query, use QueryEmployeeInfos() to start a query builder.

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 Join() and 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

Create a new EmployeeInfo object and initialize to default values.

func (*EmployeeInfo) Delete added in v0.7.0

func (o *EmployeeInfo) Delete(ctx context.Context)

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 or re-initialize a EmployeeInfo database object to default values.

func (*EmployeeInfo) IsDirty added in v0.7.0

func (o *EmployeeInfo) IsDirty() bool

func (*EmployeeInfo) LoadPerson added in v0.7.0

func (o *EmployeeInfo) LoadPerson(ctx context.Context) *Person

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

func (o *EmployeeInfo) MarshalBinary() ([]byte, error)

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

func (o *EmployeeInfo) MarshalJSON() (data []byte, err error)

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) 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

func (*EmployeeInfo) Save added in v0.7.0

func (o *EmployeeInfo) Save(ctx context.Context)

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

func (o *EmployeeInfo) UnmarshalBinary(data []byte) (err error)

func (*EmployeeInfo) UnmarshalJSON added in v0.15.0

func (o *EmployeeInfo) UnmarshalJSON(data []byte) (err error)

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

func (o *EmployeeInfo) UnmarshalStringMap(m map[string]interface{}) (err error)

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

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

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

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

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

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) 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

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

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

func LoadGift(ctx context.Context, primaryKey int, joinOrSelectNodes ...query.NodeI) *Gift

Load 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 Join() and Select() for more info.

func LoadGiftByNumber added in v0.13.9

func LoadGiftByNumber(ctx context.Context, number int, joinOrSelectNodes ...query.NodeI) *Gift

LoadGiftByNumber queries for a single Gift 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 Join() and Select() for more info. If you need a more elaborate query, use QueryGifts() to start a query builder.

func NewGift added in v0.13.9

func NewGift() *Gift

Create a new Gift object and initialize to default values.

func (*Gift) Delete added in v0.13.9

func (o *Gift) Delete(ctx context.Context)

Delete deletes the associated record from 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 or re-initialize a Gift database object to default values.

func (*Gift) IsDirty added in v0.13.9

func (o *Gift) IsDirty() bool

func (*Gift) MarshalBinary added in v0.13.9

func (o *Gift) MarshalBinary() ([]byte, error)

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

func (o *Gift) MarshalJSON() (data []byte, err error)

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) PrimaryKey added in v0.13.9

func (o *Gift) PrimaryKey() int

func (*Gift) Save added in v0.13.9

func (o *Gift) Save(ctx context.Context)

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

func (o *Gift) 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 (*Gift) UnmarshalBinary added in v0.13.9

func (o *Gift) UnmarshalBinary(data []byte) (err error)

func (*Gift) UnmarshalJSON added in v0.15.0

func (o *Gift) UnmarshalJSON(data []byte) (err error)

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

func (o *Gift) UnmarshalStringMap(m map[string]interface{}) (err error)

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) 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

func LoadLogin(ctx context.Context, primaryKey string, joinOrSelectNodes ...query.NodeI) *Login

Load 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 Join() and Select() for more info.

func LoadLoginByID added in v0.10.0

func LoadLoginByID(ctx context.Context, id string, joinOrSelectNodes ...query.NodeI) *Login

LoadLoginByID 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 Join() and Select() for more info. If you need a more elaborate query, use QueryLogins() to start a query builder.

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 Join() and 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 Join() and Select() for more info. If you need a more elaborate query, use QueryLogins() to start a query builder.

func NewLogin

func NewLogin() *Login

Create a new Login object and initialize to default values.

func (*Login) Delete

func (o *Login) Delete(ctx context.Context)

Delete deletes the associated record from 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) ID

func (o *Login) ID() string

ID returns the loaded value of ID.

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 or re-initialize a Login database object to default values.

func (*Login) IsDirty

func (o *Login) IsDirty() bool

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) LoadPerson

func (o *Login) LoadPerson(ctx context.Context) *Person

LoadPerson returns the related Person. If it is not already loaded, it will attempt to load it first.

func (*Login) MarshalBinary

func (o *Login) MarshalBinary() ([]byte, error)

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

func (o *Login) MarshalJSON() (data []byte, err error)

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) 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

func (*Login) Save

func (o *Login) Save(ctx context.Context)

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) SetPerson

func (o *Login) SetPerson(v *Person)

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

func (o *Login) 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 (*Login) UnmarshalBinary

func (o *Login) UnmarshalBinary(data []byte) (err error)

func (*Login) UnmarshalJSON added in v0.15.0

func (o *Login) UnmarshalJSON(data []byte) (err error)

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

func (o *Login) UnmarshalStringMap(m map[string]interface{}) (err error)

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) 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

Load 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 Join() and Select() for more info.

func LoadMilestoneByID added in v0.10.0

func LoadMilestoneByID(ctx context.Context, id string, joinOrSelectNodes ...query.NodeI) *Milestone

LoadMilestoneByID queries for a single Milestone 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 Join() and Select() for more info. If you need a more elaborate query, use QueryMilestones() to start a query builder.

func NewMilestone

func NewMilestone() *Milestone

Create a new Milestone object and initialize to default values.

func (*Milestone) Delete

func (o *Milestone) Delete(ctx context.Context)

Delete deletes the associated record from 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) ID

func (o *Milestone) ID() string

ID returns the loaded value of ID.

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 or re-initialize a Milestone database object to default values.

func (*Milestone) IsDirty

func (o *Milestone) IsDirty() bool

func (*Milestone) LoadProject

func (o *Milestone) LoadProject(ctx context.Context) *Project

LoadProject returns the related Project. If it is not already loaded, it will attempt to load it first.

func (*Milestone) MarshalBinary

func (o *Milestone) MarshalBinary() ([]byte, error)

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

func (o *Milestone) MarshalJSON() (data []byte, err error)

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) Name

func (o *Milestone) Name() string

Name returns the loaded value of Name.

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) PrimaryKey

func (o *Milestone) PrimaryKey() string

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

func (o *Milestone) Save(ctx context.Context)

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

func (o *Milestone) 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 (*Milestone) UnmarshalBinary

func (o *Milestone) UnmarshalBinary(data []byte) (err error)

func (*Milestone) UnmarshalJSON added in v0.15.0

func (o *Milestone) UnmarshalJSON(data []byte) (err error)

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

func (o *Milestone) UnmarshalStringMap(m map[string]interface{}) (err error)

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

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

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

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) 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

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) 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

func LoadPerson(ctx context.Context, primaryKey string, joinOrSelectNodes ...query.NodeI) *Person

Load 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 Join() and Select() for more info.

func LoadPersonByID added in v0.10.0

func LoadPersonByID(ctx context.Context, id string, joinOrSelectNodes ...query.NodeI) *Person

LoadPersonByID queries for a single Person 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 Join() and Select() for more info. If you need a more elaborate query, use QueryPeople() to start a query builder.

func NewPerson

func NewPerson() *Person

Create a new Person object and initialize to default values.

func (*Person) Address

func (o *Person) Address(pk string) *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) CountAddresses added in v0.10.0

func (o *Person) CountAddresses(ctx context.Context) int

CountAddresses returns the number of Address objects in the database connected to this object.

func (*Person) CountProjectsAsManager added in v0.10.0

func (o *Person) CountProjectsAsManager(ctx context.Context) int

CountProjectsAsManager returns the number of Project objects in the database connected to this object.

func (*Person) Delete

func (o *Person) Delete(ctx context.Context)

Delete deletes the associated record from the database.

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) ID

func (o *Person) ID() string

ID returns the loaded value of ID.

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 or re-initialize a Person database object to default values.

func (*Person) IsDirty

func (o *Person) IsDirty() bool

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

func (o *Person) LoadAddresses(ctx context.Context, conditions ...interface{}) []*Address

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

func (o *Person) LoadLogin(ctx context.Context) *Login

LoadLogin returns the connected Login object, if one was loaded. Otherwise, it will load a new one and return it.

func (*Person) LoadProjectsAsManager

func (o *Person) LoadProjectsAsManager(ctx context.Context, conditions ...interface{}) []*Project

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

func (o *Person) MarshalBinary() ([]byte, error)

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

func (o *Person) MarshalJSON() (data []byte, err error)

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) PersonTypes

func (o *Person) PersonTypes() []PersonType

PersonTypes returns a slice of PersonType values if loaded.

func (*Person) PrimaryKey

func (o *Person) PrimaryKey() string

func (*Person) ProjectAsManager

func (o *Person) ProjectAsManager(pk string) *Project

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) ProjectAsTeamMember

func (o *Person) ProjectAsTeamMember(pk string) *Project

ProjectAsTeamMember returns a single Project object by primary key, if one was loaded otherwise, it will return nil.

func (*Person) ProjectsAsManager

func (o *Person) ProjectsAsManager() []*Project

ProjectsAsManager returns a slice of Project objects if loaded.

func (*Person) ProjectsAsTeamMember

func (o *Person) ProjectsAsTeamMember() []*Project

ProjectsAsTeamMember returns a slice of Project objects if loaded. If not loaded, will return nil.

func (*Person) Save

func (o *Person) Save(ctx context.Context)

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) 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. 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) 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. 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) 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) 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) SetProjectsAsTeamMember added in v0.9.0

func (o *Person) SetProjectsAsTeamMember(objs []*Project)

SetProjectsAsTeamMember sets the associated objects to the given slice of Project objects. It will disassociate from all previously associated objects after saving.

func (*Person) String

func (o *Person) 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 (*Person) UnmarshalBinary

func (o *Person) UnmarshalBinary(data []byte) (err error)

func (*Person) UnmarshalJSON added in v0.15.0

func (o *Person) UnmarshalJSON(data []byte) (err error)

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

func (o *Person) UnmarshalStringMap(m map[string]interface{}) (err error)

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 items

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 (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

Load 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 Join() and Select() for more info.

func LoadPersonWithLockByID added in v0.10.0

func LoadPersonWithLockByID(ctx context.Context, id string, joinOrSelectNodes ...query.NodeI) *PersonWithLock

LoadPersonWithLockByID queries for a single PersonWithLock 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 Join() and Select() for more info. If you need a more elaborate query, use QueryPersonWithLocks() to start a query builder.

func NewPersonWithLock

func NewPersonWithLock() *PersonWithLock

Create a new PersonWithLock object and initialize to default values.

func (*PersonWithLock) Delete

func (o *PersonWithLock) Delete(ctx context.Context)

Delete deletes the associated record from 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) ID

func (o *PersonWithLock) ID() string

ID returns the loaded value of ID.

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 or re-initialize a PersonWithLock database object to default values.

func (*PersonWithLock) IsDirty

func (o *PersonWithLock) IsDirty() bool

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

func (o *PersonWithLock) MarshalBinary() ([]byte, error)

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

func (o *PersonWithLock) MarshalJSON() (data []byte, err error)

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) PrimaryKey

func (o *PersonWithLock) PrimaryKey() string

func (*PersonWithLock) Save

func (o *PersonWithLock) Save(ctx context.Context)

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

func (o *PersonWithLock) SysTimestamp() datetime.DateTime

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

func (o *PersonWithLock) UnmarshalBinary(data []byte) (err error)

func (*PersonWithLock) UnmarshalJSON added in v0.15.0

func (o *PersonWithLock) UnmarshalJSON(data []byte) (err error)

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" - datetime.DateTime, nullable

func (*PersonWithLock) UnmarshalStringMap added in v0.15.0

func (o *PersonWithLock) UnmarshalStringMap(m map[string]interface{}) (err error)

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

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

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

Expand expands an array type node so that it will produce individual rows instead of an array of items

func (*PersonWithLocksBuilder) Get

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

GroupBy controls how results are grouped when using aggregate functions in an Alias() call.

func (*PersonWithLocksBuilder) Having

Having does additional filtering on the results of the query.

func (*PersonWithLocksBuilder) Join

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) 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

OrderBy specifies how the resulting data should be sorted.

func (*PersonWithLocksBuilder) Select

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

Where adds a condition to filter what gets selected.

type Project

type Project struct {
	// contains filtered or unexported fields
}

func LoadProject

func LoadProject(ctx context.Context, primaryKey string, joinOrSelectNodes ...query.NodeI) *Project

Load 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 Join() and Select() for more info.

func LoadProjectByID added in v0.10.0

func LoadProjectByID(ctx context.Context, id string, joinOrSelectNodes ...query.NodeI) *Project

LoadProjectByID 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 Join() and Select() for more info. If you need a more elaborate query, use QueryProjects() to start a query builder.

func LoadProjectByNum

func LoadProjectByNum(ctx context.Context, num int, joinOrSelectNodes ...query.NodeI) *Project

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 Join() and Select() for more info. If you need a more elaborate query, use QueryProjects() to start a query builder.

func NewProject

func NewProject() *Project

Create a new Project object and initialize 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) ChildAsParent

func (o *Project) ChildAsParent(pk string) *Project

ChildAsParent returns a single Project object by primary key, if one was loaded otherwise, it will return nil.

func (*Project) ChildrenAsParent

func (o *Project) ChildrenAsParent() []*Project

ChildrenAsParent returns a slice of Project objects if loaded. If not loaded, will return nil.

func (*Project) CountMilestones added in v0.10.0

func (o *Project) CountMilestones(ctx context.Context) int

CountMilestones returns the number of Milestone objects in the database connected to this object.

func (*Project) Delete

func (o *Project) Delete(ctx context.Context)

Delete deletes the associated record from the database.

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) EndDate

func (o *Project) EndDate() datetime.DateTime

EndDate returns the loaded value of EndDate.

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) ID

func (o *Project) ID() string

ID returns the loaded value of ID.

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 or re-initialize a Project database object to default values.

func (*Project) IsDirty

func (o *Project) IsDirty() bool

func (*Project) LoadManager

func (o *Project) LoadManager(ctx context.Context) *Person

LoadManager returns the related Manager. If it is not already loaded, it will attempt to load it first.

func (*Project) LoadMilestones

func (o *Project) LoadMilestones(ctx context.Context, conditions ...interface{}) []*Milestone

LoadMilestones loads a new slice of Milestone objects and returns it.

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

func (o *Project) MarshalBinary() ([]byte, error)

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

func (o *Project) MarshalJSON() (data []byte, err error)

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

func (o *Project) Milestone(pk string) *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) Name

func (o *Project) Name() string

Name returns the loaded value of Name.

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) Num

func (o *Project) Num() int

Num returns the loaded value of Num.

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) ParentAsChild

func (o *Project) ParentAsChild(pk string) *Project

ParentAsChild returns a single Project object by primary key, if one was loaded otherwise, it will return nil.

func (*Project) ParentsAsChild

func (o *Project) ParentsAsChild() []*Project

ParentsAsChild returns a slice of Project objects if loaded. If not loaded, will return nil.

func (*Project) PrimaryKey

func (o *Project) PrimaryKey() string

func (*Project) ProjectStatusType

func (o *Project) ProjectStatusType() ProjectStatusType

func (*Project) Save

func (o *Project) Save(ctx context.Context)

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) SetBudget

func (o *Project) SetBudget(i interface{})

func (*Project) SetChildrenAsParent added in v0.9.0

func (o *Project) SetChildrenAsParent(objs []*Project)

SetChildrenAsParent sets the associated objects to the given slice of Project objects. It will disassociate from all previously associated objects after saving.

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) 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) SetParentsAsChild added in v0.9.0

func (o *Project) SetParentsAsChild(objs []*Project)

SetParentsAsChild sets the associated objects to the given slice of Project objects. It will disassociate from all previously associated objects after saving.

func (*Project) SetProjectStatusType

func (o *Project) SetProjectStatusType(v ProjectStatusType)

func (*Project) SetSpent

func (o *Project) SetSpent(i interface{})

func (*Project) SetStartDate

func (o *Project) SetStartDate(i interface{})

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. It will disassociate from all previously associated objects after saving.

func (*Project) Spent

func (o *Project) Spent() string

Spent returns the loaded value of Spent.

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) StartDate

func (o *Project) StartDate() datetime.DateTime

StartDate returns the loaded value of StartDate.

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) String

func (o *Project) 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 (*Project) TeamMember

func (o *Project) TeamMember(pk string) *Person

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

func (o *Project) UnmarshalBinary(data []byte) (err error)

func (*Project) UnmarshalJSON added in v0.15.0

func (o *Project) UnmarshalJSON(data []byte) (err error)

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
"projectStatusTypeID" - uint
"managerID" - string, nullable
"name" - string
"description" - string, nullable
"startDate" - datetime.DateTime, nullable
"endDate" - datetime.DateTime, nullable
"budget" - string, nullable
"spent" - string, nullable

func (*Project) UnmarshalStringMap added in v0.15.0

func (o *Project) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in project to modify the json before sending it here.

type ProjectStatusType

type ProjectStatusType int
const (
	ProjectStatusTypeOpen ProjectStatusType = 1

	ProjectStatusTypeCancelled ProjectStatusType = 2

	ProjectStatusTypeCompleted ProjectStatusType = 3

	ProjectStatusTypePlanned ProjectStatusType = 4
)

func AllProjectStatusTypes added in v0.9.0

func AllProjectStatusTypes() (values []ProjectStatusType)

AllProjectStatusTypes returns a slice of all the ProjectStatusType items

func ProjectStatusTypeFromID added in v0.9.3

func ProjectStatusTypeFromID(id string) ProjectStatusType

ProjectStatusTypeFromID converts a ProjectStatusType ID to a ProjectStatusType

func ProjectStatusTypeFromName added in v0.15.0

func ProjectStatusTypeFromName(name string) ProjectStatusType

ProjectStatusTypeFromName converts a ProjectStatusType name to a ProjectStatusType

func (ProjectStatusType) Description

func (p ProjectStatusType) Description() string

func (ProjectStatusType) Get added in v0.12.0

func (p ProjectStatusType) Get(key string) interface{}

func (ProjectStatusType) Guidelines

func (p ProjectStatusType) Guidelines() string

func (ProjectStatusType) ID

func (p ProjectStatusType) ID() string

ID returns a string representation of the id and satisfies the IDer interface

func (ProjectStatusType) IsActive

func (p ProjectStatusType) IsActive() bool

func (ProjectStatusType) Label

func (p ProjectStatusType) 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 (ProjectStatusType) Name added in v0.12.0

func (p ProjectStatusType) Name() string

func (ProjectStatusType) String

func (p ProjectStatusType) String() string

String returns the name value of the type and satisfies the fmt.Stringer interface

func (ProjectStatusType) Value

func (p ProjectStatusType) 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

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) 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

Where adds a condition to filter what gets selected.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL