gormRepository

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GormEntity

type GormEntity[ID GormEntityId] interface {
	gpa.Entity[ID]
	TableName() string
}

type GormEntityId

type GormEntityId interface {
	gpa.Id
}

type GormRepository

type GormRepository[E GormEntity[ID], ID GormEntityId] interface {
	gpa.CrudRepository[E, ID]
}

func NewGormRepository

func NewGormRepository[E GormEntity[ID], ID GormEntityId](tx *gorm.DB) GormRepository[E, ID]

type GormRepositoryImpl

type GormRepositoryImpl[E GormEntity[ID], ID GormEntityId] struct {
	// contains filtered or unexported fields
}

func NewGormRepositoryImpl

func NewGormRepositoryImpl[E GormEntity[ID], ID GormEntityId](tx *gorm.DB) *GormRepositoryImpl[E, ID]

func (*GormRepositoryImpl[E, ID]) Delete

func (r *GormRepositoryImpl[E, ID]) Delete(e E) error

func (*GormRepositoryImpl[E, ID]) DeleteAll

func (r *GormRepositoryImpl[E, ID]) DeleteAll(e ...E) (int64, error)

func (*GormRepositoryImpl[E, ID]) DeleteAllById

func (r *GormRepositoryImpl[E, ID]) DeleteAllById(id ...ID) (int64, error)

func (*GormRepositoryImpl[E, ID]) DeleteById

func (r *GormRepositoryImpl[E, ID]) DeleteById(id ID) error

func (*GormRepositoryImpl[E, ID]) FindAllById

func (r *GormRepositoryImpl[E, ID]) FindAllById(id ...ID) (e []E, err error)

func (*GormRepositoryImpl[E, ID]) FindById

func (r *GormRepositoryImpl[E, ID]) FindById(id ID) (e E, err error)

func (*GormRepositoryImpl[E, ID]) Save

func (r *GormRepositoryImpl[E, ID]) Save(e E) error

func (*GormRepositoryImpl[E, ID]) SaveAll

func (r *GormRepositoryImpl[E, ID]) SaveAll(e ...E) (int64, error)

Jump to

Keyboard shortcuts

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