models

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Code generated by cql-gen v0.0.5, DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bicycle

type Bicycle struct {
	model.UUIDModel

	Name string
	// Bicycle BelongsTo Person (Bicycle 0..* -> 1 Person)
	Owner     Person `gorm:"references:Name;foreignKey:OwnerName"`
	OwnerName string
}

func (Bicycle) Equal

func (m Bicycle) Equal(other Bicycle) bool

func (Bicycle) GetOwner

func (m Bicycle) GetOwner() (*Person, error)

type Brand

type Brand struct {
	model.UIntModel

	Name string
}

func (Brand) Equal

func (m Brand) Equal(other Brand) bool

type Child

type Child struct {
	model.UUIDModel

	Name   string
	Number int

	Parent1   Parent1
	Parent1ID model.UUID

	Parent2   Parent2
	Parent2ID model.UUID
}

func (Child) Equal

func (m Child) Equal(other Child) bool

func (Child) GetParent1

func (m Child) GetParent1() (*Parent1, error)

func (Child) GetParent2

func (m Child) GetParent2() (*Parent2, error)

type City

type City struct {
	model.UUIDModel

	Name      string
	Country   *Country
	CountryID model.UUID // Country HasOne City (Country 1 -> 1 City)
}

func (City) Equal

func (m City) Equal(other City) bool

func (City) GetCountry

func (m City) GetCountry() (*Country, error)

type Company

type Company struct {
	model.UUIDModel

	Name    string
	Sellers *[]Seller // Company HasMany Sellers (Company 0..1 -> 0..* Seller)
}

func (Company) Equal

func (m Company) Equal(other Company) bool

func (Company) GetSellers

func (m Company) GetSellers() ([]Seller, error)

type Country

type Country struct {
	model.UUIDModel

	Name    string
	Capital City // Country HasOne City (Country 1 -> 1 City)
}

func (Country) Equal

func (m Country) Equal(other Country) bool

func (Country) GetCapital

func (m Country) GetCapital() (*City, error)

type Employee

type Employee struct {
	model.UUIDModel

	Name   string
	Boss   *Employee // Self-Referential Has One (Employee 0..* -> 0..1 Employee)
	BossID *model.UUID
}

func (Employee) Equal

func (m Employee) Equal(other Employee) bool

func (Employee) GetBoss

func (m Employee) GetBoss() (*Employee, error)

type MultiString

type MultiString []string

func (MultiString) GormDBDataType

func (MultiString) GormDBDataType(db *gorm.DB, _ *schema.Field) string

func (MultiString) GormDataType

func (MultiString) GormDataType() string

func (*MultiString) Scan

func (s *MultiString) Scan(src interface{}) error

func (MultiString) Value

func (s MultiString) Value() (driver.Value, error)

type Parent1

type Parent1 struct {
	model.UUIDModel

	ParentParent   ParentParent
	ParentParentID model.UUID
}

func (Parent1) Equal

func (m Parent1) Equal(other Parent1) bool

func (Parent1) GetParentParent

func (m Parent1) GetParentParent() (*ParentParent, error)

type Parent2

type Parent2 struct {
	model.UUIDModel

	ParentParent   ParentParent
	ParentParentID model.UUID
}

func (Parent2) Equal

func (m Parent2) Equal(other Parent2) bool

func (Parent2) GetParentParent

func (m Parent2) GetParentParent() (*ParentParent, error)

type ParentParent

type ParentParent struct {
	model.UUIDModel

	Name   string
	Number int
}

func (ParentParent) Equal

func (m ParentParent) Equal(other ParentParent) bool

type Person

type Person struct {
	model.UUIDModel

	Name string `gorm:"unique;type:VARCHAR(255)"`
}

func (Person) TableName

func (m Person) TableName() string

type Phone

type Phone struct {
	model.UIntModel

	Name string
	// Phone belongsTo Brand (Phone 0..* -> 1 Brand)
	Brand   Brand
	BrandID uint
}

func (Phone) Equal

func (m Phone) Equal(other Phone) bool

func (Phone) GetBrand

func (m Phone) GetBrand() (*Brand, error)

type Product

type Product struct {
	model.UUIDModel

	String      string `gorm:"column:string_something_else"`
	Int         int
	IntPointer  *int
	Float       float64
	NullFloat   sql.NullFloat64
	Bool        bool
	NullBool    sql.NullBool
	ByteArray   []byte
	MultiString MultiString
	ToBeEmbedded
	GormEmbedded ToBeGormEmbedded `gorm:"embedded;embeddedPrefix:gorm_embedded_"`
}

func (Product) Equal

func (m Product) Equal(other Product) bool

type Sale

type Sale struct {
	model.UUIDModel

	Code        int
	Description string

	// Sale belongsTo Product (Sale 0..* -> 1 Product)
	Product   Product
	ProductID model.UUID

	// Sale belongsTo Seller (Sale 0..* -> 0..1 Seller)
	Seller   *Seller
	SellerID *model.UUID
}

func (Sale) Equal

func (m Sale) Equal(other Sale) bool

func (Sale) GetProduct

func (m Sale) GetProduct() (*Product, error)

func (Sale) GetSeller

func (m Sale) GetSeller() (*Seller, error)

type Seller

type Seller struct {
	model.UUIDModel

	Name      string
	Company   *Company
	CompanyID *model.UUID // Company HasMany Sellers (Company 0..1 -> 0..* Seller)

	University   *University
	UniversityID *model.UUID
}

func (Seller) Equal

func (m Seller) Equal(other Seller) bool

func (Seller) GetCompany

func (m Seller) GetCompany() (*Company, error)

func (Seller) GetUniversity

func (m Seller) GetUniversity() (*University, error)

type ToBeEmbedded

type ToBeEmbedded struct {
	EmbeddedInt int
}

type ToBeGormEmbedded

type ToBeGormEmbedded struct {
	Int int
}

type University

type University struct {
	model.UUIDModel

	Name string
}

func (University) Equal

func (m University) Equal(other University) bool

Jump to

Keyboard shortcuts

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