data

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertId

func ConvertId(id interface{}) uint64

func ConvertObjectId

func ConvertObjectId(object map[string]interface{}) map[string]interface{}

Types

type AssociationPovit

type AssociationPovit struct {
	Source *Field
	Target *Field
	//Fields      []*Field
	Association *AssociationRef
}

func NewAssociationPovit

func NewAssociationPovit(association *AssociationRef, sourceId uint64, targetId uint64) *AssociationPovit

func (*AssociationPovit) Table

func (a *AssociationPovit) Table() *table.Table

type AssociationRef

type AssociationRef struct {
	Association *graph.Association
	Added       []*Instance
	Deleted     []*Instance
	Updated     []*Instance
	Synced      []*Instance
	Clear       bool
	// contains filtered or unexported fields
}

func NewAssociation

func NewAssociation(value map[string]interface{}, assoc *graph.Association) *AssociationRef

func (*AssociationRef) Cascade

func (r *AssociationRef) Cascade() bool

func (*AssociationRef) IsEmperty

func (r *AssociationRef) IsEmperty() bool

func (*AssociationRef) IsSource

func (r *AssociationRef) IsSource() bool

func (*AssociationRef) Table

func (r *AssociationRef) Table() *table.Table

func (*AssociationRef) TypeEntity

func (r *AssociationRef) TypeEntity() *graph.Entity

type Field

type Field struct {
	Column *table.Column
	Value  interface{}
}

type Instance

type Instance struct {
	Id           uint64
	Entity       *graph.Entity
	Fields       []*Field
	Associations []*AssociationRef

	ValueMap map[string]interface{}
	// contains filtered or unexported fields
}

func NewInstance

func NewInstance(object map[string]interface{}, entity *graph.Entity) *Instance

func (*Instance) AsInsert

func (ins *Instance) AsInsert()

有ID也当插入来处理

func (*Instance) Inserted

func (ins *Instance) Inserted(id uint64)

清空其它字段,保留ID跟关系,供二次保存使用

func (*Instance) IsEmperty

func (ins *Instance) IsEmperty() bool

func (*Instance) IsInsert

func (ins *Instance) IsInsert() bool

func (*Instance) Table

func (ins *Instance) Table() *table.Table

Jump to

Keyboard shortcuts

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