graph

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: 6 Imported by: 5

Documentation

Index

Constants

View Source
const PREFIX_T string = "t"

Variables

This section is empty.

Functions

func NewAttributeColumn

func NewAttributeColumn(attr *Attribute) *table.Column

func NewEntityTable

func NewEntityTable(entity *Entity) *table.Table

func NewRelationTable

func NewRelationTable(relation *Relation) *table.Table

Types

type ArgAssociation

type ArgAssociation struct {
	Association   *Association
	TypeArgEntity *ArgEntity
}

type ArgEntity

type ArgEntity struct {
	Id             int
	Entity         *Entity
	Associations   []*ArgAssociation
	ExpressionArgs map[string]interface{}
}

func BuildArgEntity

func BuildArgEntity(entity *Entity, where interface{}, ider Ider) *ArgEntity

func (*ArgEntity) Alise

func (e *ArgEntity) Alise() string

func (*ArgEntity) GetAssociation

func (a *ArgEntity) GetAssociation(name string) *ArgAssociation

func (*ArgEntity) GetWithMakeAssociation

func (a *ArgEntity) GetWithMakeAssociation(name string, ider Ider) *ArgAssociation

type Association

type Association struct {
	Relation       *Relation
	OwnerClassUuid string
}

func NewAssociation

func NewAssociation(r *Relation, ownerUuid string) *Association

func (*Association) Description

func (a *Association) Description() string

func (*Association) GetName

func (a *Association) GetName() string

func (*Association) IsArray

func (a *Association) IsArray() bool

func (*Association) IsCombination

func (a *Association) IsCombination() bool
	if a.isNTo1() && !a.IsSource() && a.isOneWay() {
		return true
	}
	return false
}

func (*Association) IsSource

func (a *Association) IsSource() bool

func (*Association) Name

func (a *Association) Name() string

func (*Association) Owner

func (a *Association) Owner() *Entity

func (*Association) OwnerColumn

func (r *Association) OwnerColumn() *table.Column

func (*Association) Path

func (a *Association) Path() string

func (*Association) SourceColumn

func (r *Association) SourceColumn() *table.Column

func (*Association) Table

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

func (*Association) TargetColumn

func (r *Association) TargetColumn() *table.Column

func (*Association) TypeColumn

func (r *Association) TypeColumn() *table.Column

func (*Association) TypeEntity

func (a *Association) TypeEntity() *Entity

type Attribute

type Attribute struct {
	domain.Attribute
	Class           *Class
	EumnType        *Enum
	EnityType       *Entity
	ValueObjectType *Class
}

func NewAttribute

func NewAttribute(a *domain.Attribute, c *Class) *Attribute

func (*Attribute) GetEnityType

func (a *Attribute) GetEnityType() *Entity

func (*Attribute) GetEumnType

func (a *Attribute) GetEumnType() *Enum

func (*Attribute) GetName

func (a *Attribute) GetName() string

func (*Attribute) GetType

func (a *Attribute) GetType() string

type Class

type Class struct {
	Domain *domain.Class
	// contains filtered or unexported fields
}

func NewClass

func NewClass(c *domain.Class) *Class

func (*Class) AddAssociation

func (c *Class) AddAssociation(a *Association)

func (*Class) AggregateName

func (c *Class) AggregateName() string

func (*Class) DeleteByIdName

func (c *Class) DeleteByIdName() string

func (*Class) DeleteName

func (c *Class) DeleteName() string

func (*Class) Description

func (c *Class) Description() string

func (*Class) InnerId

func (c *Class) InnerId() uint64

func (*Class) IsSoftDelete

func (c *Class) IsSoftDelete() bool

func (*Class) ListName

func (c *Class) ListName() string

func (*Class) Name

func (c *Class) Name() string

func (*Class) QueryAggregateName

func (c *Class) QueryAggregateName() string

func (*Class) QueryName

func (c *Class) QueryName() string

func (*Class) QueryOneName

func (c *Class) QueryOneName() string

func (*Class) SetName

func (c *Class) SetName() string

func (*Class) TableName

func (c *Class) TableName() string

func (*Class) UpsertName

func (c *Class) UpsertName() string

func (*Class) UpsertOneName

func (c *Class) UpsertOneName() string

func (*Class) Uuid

func (c *Class) Uuid() string

type Entity

type Entity struct {
	Class
	Table      *table.Table
	Interfaces []*Interface
}

func NewEntity

func NewEntity(c *domain.Class) *Entity

func (*Entity) AllAttributeNames

func (e *Entity) AllAttributeNames() []string

func (*Entity) AllAttributes

func (e *Entity) AllAttributes() []*Attribute

包含继承来的

func (*Entity) Associations

func (e *Entity) Associations() []*Association

func (*Entity) GetAssociationByName

func (e *Entity) GetAssociationByName(name string) *Association

func (*Entity) GetAttributeByName

func (e *Entity) GetAttributeByName(name string) *Attribute

func (*Entity) GetHasManyName

func (e *Entity) GetHasManyName() string

func (*Entity) GetHasOneName

func (e *Entity) GetHasOneName() string

func (*Entity) IsEmperty

func (e *Entity) IsEmperty() bool

type Enum

type Enum struct {
	domain.Enum
}

func NewEnum

func NewEnum(e *domain.Enum) *Enum

type Ider

type Ider interface {
	CreateId() int
}

type Interface

type Interface struct {
	Class
	Children []*Entity
	Parents  []*Interface
}

func NewInterface

func NewInterface(c *domain.Class) *Interface

func (*Interface) AllAssociations

func (f *Interface) AllAssociations() []*Association

func (*Interface) AllAttributeNames

func (f *Interface) AllAttributeNames() []string

func (*Interface) AllAttributes

func (f *Interface) AllAttributes() []*Attribute

func (*Interface) GetAssociationByName

func (f *Interface) GetAssociationByName(name string) *Association

func (*Interface) GetAttributeByName

func (f *Interface) GetAttributeByName(name string) *Attribute

func (*Interface) IsEmperty

func (f *Interface) IsEmperty() bool

type Model

type Model struct {
	Enums        []*Enum
	Interfaces   []*Interface
	Entities     []*Entity
	ThirdParties []*ThirdParty
	ValueObjects []*Class
	Relations    []*Relation
	Tables       []*table.Table
}

func New

func New(m *domain.Model) *Model

func (*Model) GetEntityByInnerId

func (m *Model) GetEntityByInnerId(innerId uint64) *Entity

func (*Model) GetEntityByName

func (m *Model) GetEntityByName(name string) *Entity

func (*Model) GetEntityByUuid

func (m *Model) GetEntityByUuid(uuid string) *Entity

func (*Model) GetEnumByUuid

func (m *Model) GetEnumByUuid(uuid string) *Enum

func (*Model) GetInterfaceByName

func (m *Model) GetInterfaceByName(name string) *Interface

func (*Model) GetInterfaceByUuid

func (m *Model) GetInterfaceByUuid(uuid string) *Interface

func (*Model) GetThirdPartyByName

func (m *Model) GetThirdPartyByName(name string) *ThirdParty

func (*Model) GetValueObjectByUuid

func (m *Model) GetValueObjectByUuid(uuid string) *Class

func (*Model) RootEnities

func (m *Model) RootEnities() []*Entity

func (*Model) RootInterfaces

func (m *Model) RootInterfaces() []*Interface

func (*Model) Validate

func (m *Model) Validate()

type Propertier

type Propertier interface {
	GetName() string
	GetType() string
	GetEumnType() *Enum
	GetEnityType() *Entity
}

type QueryArg

type QueryArg = map[string]interface{}

type Relation

type Relation struct {
	AppId                  uint64
	Uuid                   string
	InnerId                uint64
	RelationType           string
	SourceEntity           *Entity
	TargetEntity           *Entity
	RoleOfTarget           string
	RoleOfSource           string
	DescriptionOnSource    string
	DescriptionOnTarget    string
	SourceMutiplicity      string
	TargetMultiplicity     string
	EnableAssociaitonClass bool
	AssociationClass       meta.AssociationClass
	Table                  *table.Table
}

func NewRelation

func NewRelation(
	r *domain.Relation,
	sourceEntity *Entity,
	targetEntity *Entity,
) *Relation

type ThirdParty

type ThirdParty struct {
	Class
}

func NewThirdParty

func NewThirdParty(c *domain.Class) *ThirdParty

func (*ThirdParty) Attributes

func (t *ThirdParty) Attributes() []*Attribute

Jump to

Keyboard shortcuts

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