So far so good
This commit is contained in:
83
examples/bun/sql_core_process.go
Executable file
83
examples/bun/sql_core_process.go
Executable file
@@ -0,0 +1,83 @@
|
||||
package models_bun
|
||||
|
||||
import "fmt"
|
||||
import db "github.com/bitechdev/GoCore/pkg/models"
|
||||
import "github.com/bitechdev/GoCore/pkg/types"
|
||||
import "github.com/uptrace/bun"
|
||||
import resolvespec_common "github.com/bitechdev/ResolveSpec/pkg/common"
|
||||
|
||||
//ModelCoreProcess - Generated Table for Schema core
|
||||
type ModelCoreProcess struct {
|
||||
bun.BaseModel `bun:"table:core.process,alias:process"`
|
||||
Completedate resolvespec_common.SqlDate `json:"completedate" bun:"completedate,type:date,"`
|
||||
Completetime types.CustomIntTime `json:"completetime" bun:"completetime,type:integer,"`
|
||||
Description resolvespec_common.SqlString `json:"description" bun:"description,type:citext,"`
|
||||
GUID resolvespec_common.SqlUUID `json:"guid" bun:"guid,type:uuid,default:newid(),"`
|
||||
Ridcompleteuser resolvespec_common.SqlInt32 `json:"rid_completeuser" bun:"rid_completeuser,type:integer,"`
|
||||
Ridhub resolvespec_common.SqlInt32 `json:"rid_hub" bun:"rid_hub,type:integer,"`
|
||||
Ridmasterprocess resolvespec_common.SqlInt32 `json:"rid_masterprocess" bun:"rid_masterprocess,type:integer,"`
|
||||
Ridprocess resolvespec_common.SqlInt32 `json:"rid_process" bun:"rid_process,type:integer,pk,default:nextval('core.identity_process_rid_process'::regclass),"`
|
||||
Status resolvespec_common.SqlString `json:"status" bun:"status,type:citext,"`
|
||||
Updatecnt int64 `json:"updatecnt" bun:"updatecnt,type:integer,default:0,"`
|
||||
HUB *ModelCoreHub `json:"HUB,omitempty" bun:"rel:has-one,join:rid_hub=rid_hub"`
|
||||
MPR *ModelCoreMasterprocess `json:"MPR,omitempty" bun:"rel:has-one,join:rid_masterprocess=rid_masterprocess"`
|
||||
|
||||
TAS []*ModelCoreTasklist `json:"TAS,omitempty" bun:"rel:has-many,join:rid_process=rid_process"`
|
||||
db.DBAdhocBuffer `json:",omitempty" bun:",scanonly"`
|
||||
db.DBGetIDInterface `json:",omitempty" bun:"-"`
|
||||
types.SQLTypable `json:",omitempty" bun:"-"`
|
||||
}
|
||||
|
||||
// TableName - Returns the table name for the object.
|
||||
func (m ModelCoreProcess) TableName() string {
|
||||
return "core.process"
|
||||
}
|
||||
|
||||
// TableName - Returns the table name for the object.
|
||||
func (m ModelCoreProcess) TableNameOnly() string {
|
||||
return "process"
|
||||
}
|
||||
|
||||
// SchemaName - Returns the schema name for the object.
|
||||
func (m ModelCoreProcess) SchemaName() string {
|
||||
return "core"
|
||||
}
|
||||
|
||||
// GetID - ID interface
|
||||
func (m ModelCoreProcess) GetID() int64 {
|
||||
return m.Ridprocess.Int64()
|
||||
}
|
||||
|
||||
// GetIDStr - ID interface
|
||||
func (m ModelCoreProcess) GetIDStr() string {
|
||||
return fmt.Sprintf("%d", m.Ridprocess)
|
||||
}
|
||||
|
||||
// SetID - ID interface
|
||||
func (m ModelCoreProcess) SetID(newid int64) {
|
||||
m.UpdateID(newid)
|
||||
}
|
||||
|
||||
func (m *ModelCoreProcess) UpdateID(newid int64) {
|
||||
m.Ridprocess.FromString(fmt.Sprintf("%d", newid))
|
||||
}
|
||||
|
||||
// GetIDName - ID interface
|
||||
func (m ModelCoreProcess) GetIDName() string {
|
||||
return "rid_process"
|
||||
}
|
||||
|
||||
// GetPrefix - Returns a table prefix
|
||||
func (m ModelCoreProcess) GetPrefix() string {
|
||||
return "PRO"
|
||||
}
|
||||
|
||||
// GetRowNumber - Returns the row number of the record
|
||||
func (m ModelCoreProcess) GetRowNumber() int64 {
|
||||
return m.RowNumber
|
||||
}
|
||||
|
||||
// SetRowNumber - Set the row number of a record
|
||||
func (m *ModelCoreProcess) SetRowNumber(num int64) {
|
||||
m.RowNumber = num
|
||||
}
|
||||
Reference in New Issue
Block a user