Skip to content

A continuation of HomeBox the inventory and organization system built for the Home User

22.0 KB
Raw Blame
// Code generated by ent, DO NOT EDIT.

package ent

import (
	"fmt"
	"strings"
	"time"

	"entgo.io/ent"
	"entgo.io/ent/dialect/sql"
	"github.com/google/uuid"
	"github.com/sysadminsmedia/homebox/backend/internal/data/ent/entity"
	"github.com/sysadminsmedia/homebox/backend/internal/data/ent/entitytype"
	"github.com/sysadminsmedia/homebox/backend/internal/data/ent/group"
)

// Entity is the model entity for the Entity schema.
type Entity struct {
	config `json:"-"`
	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// ImportRef holds the value of the "import_ref" field.
	ImportRef string `json:"import_ref,omitempty"`
	// Notes holds the value of the "notes" field.
	Notes string `json:"notes,omitempty"`
	// Quantity holds the value of the "quantity" field.
	Quantity float64 `json:"quantity,omitempty"`
	// Insured holds the value of the "insured" field.
	Insured bool `json:"insured,omitempty"`
	// Archived holds the value of the "archived" field.
	Archived bool `json:"archived,omitempty"`
	// AssetID holds the value of the "asset_id" field.
	AssetID int64 `json:"asset_id,omitempty"`
	// SyncChildEntityLocations holds the value of the "sync_child_entity_locations" field.
	SyncChildEntityLocations bool `json:"sync_child_entity_locations,omitempty"`
	// SerialNumber holds the value of the "serial_number" field.
	SerialNumber string `json:"serial_number,omitempty"`
	// ModelNumber holds the value of the "model_number" field.
	ModelNumber string `json:"model_number,omitempty"`
	// Manufacturer holds the value of the "manufacturer" field.
	Manufacturer string `json:"manufacturer,omitempty"`
	// LifetimeWarranty holds the value of the "lifetime_warranty" field.
	LifetimeWarranty bool `json:"lifetime_warranty,omitempty"`
	// WarrantyExpires holds the value of the "warranty_expires" field.
	WarrantyExpires time.Time `json:"warranty_expires,omitempty"`
	// WarrantyDetails holds the value of the "warranty_details" field.
	WarrantyDetails string `json:"warranty_details,omitempty"`
	// PurchaseDate holds the value of the "purchase_date" field.
	PurchaseDate time.Time `json:"purchase_date,omitempty"`
	// PurchaseFrom holds the value of the "purchase_from" field.
	PurchaseFrom string `json:"purchase_from,omitempty"`
	// PurchasePrice holds the value of the "purchase_price" field.
	PurchasePrice float64 `json:"purchase_price,omitempty"`
	// SoldDate holds the value of the "sold_date" field.
	SoldDate time.Time `json:"sold_date,omitempty"`
	// SoldTo holds the value of the "sold_to" field.
	SoldTo string `json:"sold_to,omitempty"`
	// SoldPrice holds the value of the "sold_price" field.
	SoldPrice float64 `json:"sold_price,omitempty"`
	// SoldNotes holds the value of the "sold_notes" field.
	SoldNotes string `json:"sold_notes,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the EntityQuery when eager-loading is set.
	Edges                    EntityEdges `json:"edges"`
	entity_children          *uuid.UUID
	entity_location_entities *uuid.UUID
	entity_type_entities     *uuid.UUID
	group_entities           *uuid.UUID
	selectValues             sql.SelectValues
}

// EntityEdges holds the relations/edges for other nodes in the graph.
type EntityEdges struct {
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// Parent holds the value of the parent edge.
	Parent *Entity `json:"parent,omitempty"`
	// Children holds the value of the children edge.
	Children []*Entity `json:"children,omitempty"`
	// Location holds the value of the location edge.
	Location *Entity `json:"location,omitempty"`
	// LocationEntities holds the value of the location_entities edge.
	LocationEntities []*Entity `json:"location_entities,omitempty"`
	// Tag holds the value of the tag edge.
	Tag []*Tag `json:"tag,omitempty"`
	// EntityType holds the value of the entity_type edge.
	EntityType *EntityType `json:"entity_type,omitempty"`
	// Fields holds the value of the fields edge.
	Fields []*EntityField `json:"fields,omitempty"`
	// MaintenanceEntries holds the value of the maintenance_entries edge.
	MaintenanceEntries []*MaintenanceEntry `json:"maintenance_entries,omitempty"`
	// Attachments holds the value of the attachments edge.
	Attachments []*Attachment `json:"attachments,omitempty"`
	// loadedTypes holds the information for reporting if a
	// type was loaded (or requested) in eager-loading or not.
	loadedTypes [10]bool
}

// GroupOrErr returns the Group value or an error if the edge
// was not loaded in eager-loading, or loaded but was not found.
func (e EntityEdges) GroupOrErr() (*Group, error) {
	if e.Group != nil {
		return e.Group, nil
	} else if e.loadedTypes[0] {
		return nil, &NotFoundError{label: group.Label}
	}
	return nil, &NotLoadedError{edge: "group"}
}

// ParentOrErr returns the Parent value or an error if the edge
// was not loaded in eager-loading, or loaded but was not found.
func (e EntityEdges) ParentOrErr() (*Entity, error) {
	if e.Parent != nil {
		return e.Parent, nil
	} else if e.loadedTypes[1] {
		return nil, &NotFoundError{label: entity.Label}
	}
	return nil, &NotLoadedError{edge: "parent"}
}

// ChildrenOrErr returns the Children value or an error if the edge
// was not loaded in eager-loading.
func (e EntityEdges) ChildrenOrErr() ([]*Entity, error) {
	if e.loadedTypes[2] {
		return e.Children, nil
	}
	return nil, &NotLoadedError{edge: "children"}
}

// LocationOrErr returns the Location value or an error if the edge
// was not loaded in eager-loading, or loaded but was not found.
func (e EntityEdges) LocationOrErr() (*Entity, error) {
	if e.Location != nil {
		return e.Location, nil
	} else if e.loadedTypes[3] {
		return nil, &NotFoundError{label: entity.Label}
	}
	return nil, &NotLoadedError{edge: "location"}
}

// LocationEntitiesOrErr returns the LocationEntities value or an error if the edge
// was not loaded in eager-loading.
func (e EntityEdges) LocationEntitiesOrErr() ([]*Entity, error) {
	if e.loadedTypes[4] {
		return e.LocationEntities, nil
	}
	return nil, &NotLoadedError{edge: "location_entities"}
}

// TagOrErr returns the Tag value or an error if the edge
// was not loaded in eager-loading.
func (e EntityEdges) TagOrErr() ([]*Tag, error) {
	if e.loadedTypes[5] {
		return e.Tag, nil
	}
	return nil, &NotLoadedError{edge: "tag"}
}

// EntityTypeOrErr returns the EntityType value or an error if the edge
// was not loaded in eager-loading, or loaded but was not found.
func (e EntityEdges) EntityTypeOrErr() (*EntityType, error) {
	if e.EntityType != nil {
		return e.EntityType, nil
	} else if e.loadedTypes[6] {
		return nil, &NotFoundError{label: entitytype.Label}
	}
	return nil, &NotLoadedError{edge: "entity_type"}
}

// FieldsOrErr returns the Fields value or an error if the edge
// was not loaded in eager-loading.
func (e EntityEdges) FieldsOrErr() ([]*EntityField, error) {
	if e.loadedTypes[7] {
		return e.Fields, nil
	}
	return nil, &NotLoadedError{edge: "fields"}
}

// MaintenanceEntriesOrErr returns the MaintenanceEntries value or an error if the edge
// was not loaded in eager-loading.
func (e EntityEdges) MaintenanceEntriesOrErr() ([]*MaintenanceEntry, error) {
	if e.loadedTypes[8] {
		return e.MaintenanceEntries, nil
	}
	return nil, &NotLoadedError{edge: "maintenance_entries"}
}

// AttachmentsOrErr returns the Attachments value or an error if the edge
// was not loaded in eager-loading.
func (e EntityEdges) AttachmentsOrErr() ([]*Attachment, error) {
	if e.loadedTypes[9] {
		return e.Attachments, nil
	}
	return nil, &NotLoadedError{edge: "attachments"}
}

// scanValues returns the types for scanning values from sql.Rows.
func (*Entity) scanValues(columns []string) ([]any, error) {
	values := make([]any, len(columns))
	for i := range columns {
		switch columns[i] {
		case entity.FieldInsured, entity.FieldArchived, entity.FieldSyncChildEntityLocations, entity.FieldLifetimeWarranty:
			values[i] = new(sql.NullBool)
		case entity.FieldQuantity, entity.FieldPurchasePrice, entity.FieldSoldPrice:
			values[i] = new(sql.NullFloat64)
		case entity.FieldAssetID:
			values[i] = new(sql.NullInt64)
		case entity.FieldName, entity.FieldDescription, entity.FieldImportRef, entity.FieldNotes, entity.FieldSerialNumber, entity.FieldModelNumber, entity.FieldManufacturer, entity.FieldWarrantyDetails, entity.FieldPurchaseFrom, entity.FieldSoldTo, entity.FieldSoldNotes:
			values[i] = new(sql.NullString)
		case entity.FieldCreatedAt, entity.FieldUpdatedAt, entity.FieldWarrantyExpires, entity.FieldPurchaseDate, entity.FieldSoldDate:
			values[i] = new(sql.NullTime)
		case entity.FieldID:
			values[i] = new(uuid.UUID)
		case entity.ForeignKeys[0]: // entity_children
			values[i] = &sql.NullScanner{S: new(uuid.UUID)}
		case entity.ForeignKeys[1]: // entity_location_entities
			values[i] = &sql.NullScanner{S: new(uuid.UUID)}
		case entity.ForeignKeys[2]: // entity_type_entities
			values[i] = &sql.NullScanner{S: new(uuid.UUID)}
		case entity.ForeignKeys[3]: // group_entities
			values[i] = &sql.NullScanner{S: new(uuid.UUID)}
		default:
			values[i] = new(sql.UnknownType)
		}
	}
	return values, nil
}

// assignValues assigns the values that were returned from sql.Rows (after scanning)
// to the Entity fields.
func (_m *Entity) assignValues(columns []string, values []any) error {
	if m, n := len(values), len(columns); m < n {
		return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
	}
	for i := range columns {
		switch columns[i] {
		case entity.FieldID:
			if value, ok := values[i].(*uuid.UUID); !ok {
				return fmt.Errorf("unexpected type %T for field id", values[i])
			} else if value != nil {
				_m.ID = *value
			}
		case entity.FieldCreatedAt:
			if value, ok := values[i].(*sql.NullTime); !ok {
				return fmt.Errorf("unexpected type %T for field created_at", values[i])
			} else if value.Valid {
				_m.CreatedAt = value.Time
			}
		case entity.FieldUpdatedAt:
			if value, ok := values[i].(*sql.NullTime); !ok {
				return fmt.Errorf("unexpected type %T for field updated_at", values[i])
			} else if value.Valid {
				_m.UpdatedAt = value.Time
			}
		case entity.FieldName:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field name", values[i])
			} else if value.Valid {
				_m.Name = value.String
			}
		case entity.FieldDescription:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field description", values[i])
			} else if value.Valid {
				_m.Description = value.String
			}
		case entity.FieldImportRef:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field import_ref", values[i])
			} else if value.Valid {
				_m.ImportRef = value.String
			}
		case entity.FieldNotes:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field notes", values[i])
			} else if value.Valid {
				_m.Notes = value.String
			}
		case entity.FieldQuantity:
			if value, ok := values[i].(*sql.NullFloat64); !ok {
				return fmt.Errorf("unexpected type %T for field quantity", values[i])
			} else if value.Valid {
				_m.Quantity = value.Float64
			}
		case entity.FieldInsured:
			if value, ok := values[i].(*sql.NullBool); !ok {
				return fmt.Errorf("unexpected type %T for field insured", values[i])
			} else if value.Valid {
				_m.Insured = value.Bool
			}
		case entity.FieldArchived:
			if value, ok := values[i].(*sql.NullBool); !ok {
				return fmt.Errorf("unexpected type %T for field archived", values[i])
			} else if value.Valid {
				_m.Archived = value.Bool
			}
		case entity.FieldAssetID:
			if value, ok := values[i].(*sql.NullInt64); !ok {
				return fmt.Errorf("unexpected type %T for field asset_id", values[i])
			} else if value.Valid {
				_m.AssetID = value.Int64
			}
		case entity.FieldSyncChildEntityLocations:
			if value, ok := values[i].(*sql.NullBool); !ok {
				return fmt.Errorf("unexpected type %T for field sync_child_entity_locations", values[i])
			} else if value.Valid {
				_m.SyncChildEntityLocations = value.Bool
			}
		case entity.FieldSerialNumber:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field serial_number", values[i])
			} else if value.Valid {
				_m.SerialNumber = value.String
			}
		case entity.FieldModelNumber:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field model_number", values[i])
			} else if value.Valid {
				_m.ModelNumber = value.String
			}
		case entity.FieldManufacturer:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field manufacturer", values[i])
			} else if value.Valid {
				_m.Manufacturer = value.String
			}
		case entity.FieldLifetimeWarranty:
			if value, ok := values[i].(*sql.NullBool); !ok {
				return fmt.Errorf("unexpected type %T for field lifetime_warranty", values[i])
			} else if value.Valid {
				_m.LifetimeWarranty = value.Bool
			}
		case entity.FieldWarrantyExpires:
			if value, ok := values[i].(*sql.NullTime); !ok {
				return fmt.Errorf("unexpected type %T for field warranty_expires", values[i])
			} else if value.Valid {
				_m.WarrantyExpires = value.Time
			}
		case entity.FieldWarrantyDetails:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field warranty_details", values[i])
			} else if value.Valid {
				_m.WarrantyDetails = value.String
			}
		case entity.FieldPurchaseDate:
			if value, ok := values[i].(*sql.NullTime); !ok {
				return fmt.Errorf("unexpected type %T for field purchase_date", values[i])
			} else if value.Valid {
				_m.PurchaseDate = value.Time
			}
		case entity.FieldPurchaseFrom:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field purchase_from", values[i])
			} else if value.Valid {
				_m.PurchaseFrom = value.String
			}
		case entity.FieldPurchasePrice:
			if value, ok := values[i].(*sql.NullFloat64); !ok {
				return fmt.Errorf("unexpected type %T for field purchase_price", values[i])
			} else if value.Valid {
				_m.PurchasePrice = value.Float64
			}
		case entity.FieldSoldDate:
			if value, ok := values[i].(*sql.NullTime); !ok {
				return fmt.Errorf("unexpected type %T for field sold_date", values[i])
			} else if value.Valid {
				_m.SoldDate = value.Time
			}
		case entity.FieldSoldTo:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field sold_to", values[i])
			} else if value.Valid {
				_m.SoldTo = value.String
			}
		case entity.FieldSoldPrice:
			if value, ok := values[i].(*sql.NullFloat64); !ok {
				return fmt.Errorf("unexpected type %T for field sold_price", values[i])
			} else if value.Valid {
				_m.SoldPrice = value.Float64
			}
		case entity.FieldSoldNotes:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field sold_notes", values[i])
			} else if value.Valid {
				_m.SoldNotes = value.String
			}
		case entity.ForeignKeys[0]:
			if value, ok := values[i].(*sql.NullScanner); !ok {
				return fmt.Errorf("unexpected type %T for field entity_children", values[i])
			} else if value.Valid {
				_m.entity_children = new(uuid.UUID)
				*_m.entity_children = *value.S.(*uuid.UUID)
			}
		case entity.ForeignKeys[1]:
			if value, ok := values[i].(*sql.NullScanner); !ok {
				return fmt.Errorf("unexpected type %T for field entity_location_entities", values[i])
			} else if value.Valid {
				_m.entity_location_entities = new(uuid.UUID)
				*_m.entity_location_entities = *value.S.(*uuid.UUID)
			}
		case entity.ForeignKeys[2]:
			if value, ok := values[i].(*sql.NullScanner); !ok {
				return fmt.Errorf("unexpected type %T for field entity_type_entities", values[i])
			} else if value.Valid {
				_m.entity_type_entities = new(uuid.UUID)
				*_m.entity_type_entities = *value.S.(*uuid.UUID)
			}
		case entity.ForeignKeys[3]:
			if value, ok := values[i].(*sql.NullScanner); !ok {
				return fmt.Errorf("unexpected type %T for field group_entities", values[i])
			} else if value.Valid {
				_m.group_entities = new(uuid.UUID)
				*_m.group_entities = *value.S.(*uuid.UUID)
			}
		default:
			_m.selectValues.Set(columns[i], values[i])
		}
	}
	return nil
}

// Value returns the ent.Value that was dynamically selected and assigned to the Entity.
// This includes values selected through modifiers, order, etc.
func (_m *Entity) Value(name string) (ent.Value, error) {
	return _m.selectValues.Get(name)
}

// QueryGroup queries the "group" edge of the Entity entity.
func (_m *Entity) QueryGroup() *GroupQuery {
	return NewEntityClient(_m.config).QueryGroup(_m)
}

// QueryParent queries the "parent" edge of the Entity entity.
func (_m *Entity) QueryParent() *EntityQuery {
	return NewEntityClient(_m.config).QueryParent(_m)
}

// QueryChildren queries the "children" edge of the Entity entity.
func (_m *Entity) QueryChildren() *EntityQuery {
	return NewEntityClient(_m.config).QueryChildren(_m)
}

// QueryLocation queries the "location" edge of the Entity entity.
func (_m *Entity) QueryLocation() *EntityQuery {
	return NewEntityClient(_m.config).QueryLocation(_m)
}

// QueryLocationEntities queries the "location_entities" edge of the Entity entity.
func (_m *Entity) QueryLocationEntities() *EntityQuery {
	return NewEntityClient(_m.config).QueryLocationEntities(_m)
}

// QueryTag queries the "tag" edge of the Entity entity.
func (_m *Entity) QueryTag() *TagQuery {
	return NewEntityClient(_m.config).QueryTag(_m)
}

// QueryEntityType queries the "entity_type" edge of the Entity entity.
func (_m *Entity) QueryEntityType() *EntityTypeQuery {
	return NewEntityClient(_m.config).QueryEntityType(_m)
}

// QueryFields queries the "fields" edge of the Entity entity.
func (_m *Entity) QueryFields() *EntityFieldQuery {
	return NewEntityClient(_m.config).QueryFields(_m)
}

// QueryMaintenanceEntries queries the "maintenance_entries" edge of the Entity entity.
func (_m *Entity) QueryMaintenanceEntries() *MaintenanceEntryQuery {
	return NewEntityClient(_m.config).QueryMaintenanceEntries(_m)
}

// QueryAttachments queries the "attachments" edge of the Entity entity.
func (_m *Entity) QueryAttachments() *AttachmentQuery {
	return NewEntityClient(_m.config).QueryAttachments(_m)
}

// Update returns a builder for updating this Entity.
// Note that you need to call Entity.Unwrap() before calling this method if this Entity
// was returned from a transaction, and the transaction was committed or rolled back.
func (_m *Entity) Update() *EntityUpdateOne {
	return NewEntityClient(_m.config).UpdateOne(_m)
}

// Unwrap unwraps the Entity entity that was returned from a transaction after it was closed,
// so that all future queries will be executed through the driver which created the transaction.
func (_m *Entity) Unwrap() *Entity {
	_tx, ok := _m.config.driver.(*txDriver)
	if !ok {
		panic("ent: Entity is not a transactional entity")
	}
	_m.config.driver = _tx.drv
	return _m
}

// String implements the fmt.Stringer.
func (_m *Entity) String() string {
	var builder strings.Builder
	builder.WriteString("Entity(")
	builder.WriteString(fmt.Sprintf("id=%v, ", _m.ID))
	builder.WriteString("created_at=")
	builder.WriteString(_m.CreatedAt.Format(time.ANSIC))
	builder.WriteString(", ")
	builder.WriteString("updated_at=")
	builder.WriteString(_m.UpdatedAt.Format(time.ANSIC))
	builder.WriteString(", ")
	builder.WriteString("name=")
	builder.WriteString(_m.Name)
	builder.WriteString(", ")
	builder.WriteString("description=")
	builder.WriteString(_m.Description)
	builder.WriteString(", ")
	builder.WriteString("import_ref=")
	builder.WriteString(_m.ImportRef)
	builder.WriteString(", ")
	builder.WriteString("notes=")
	builder.WriteString(_m.Notes)
	builder.WriteString(", ")
	builder.WriteString("quantity=")
	builder.WriteString(fmt.Sprintf("%v", _m.Quantity))
	builder.WriteString(", ")
	builder.WriteString("insured=")
	builder.WriteString(fmt.Sprintf("%v", _m.Insured))
	builder.WriteString(", ")
	builder.WriteString("archived=")
	builder.WriteString(fmt.Sprintf("%v", _m.Archived))
	builder.WriteString(", ")
	builder.WriteString("asset_id=")
	builder.WriteString(fmt.Sprintf("%v", _m.AssetID))
	builder.WriteString(", ")
	builder.WriteString("sync_child_entity_locations=")
	builder.WriteString(fmt.Sprintf("%v", _m.SyncChildEntityLocations))
	builder.WriteString(", ")
	builder.WriteString("serial_number=")
	builder.WriteString(_m.SerialNumber)
	builder.WriteString(", ")
	builder.WriteString("model_number=")
	builder.WriteString(_m.ModelNumber)
	builder.WriteString(", ")
	builder.WriteString("manufacturer=")
	builder.WriteString(_m.Manufacturer)
	builder.WriteString(", ")
	builder.WriteString("lifetime_warranty=")
	builder.WriteString(fmt.Sprintf("%v", _m.LifetimeWarranty))
	builder.WriteString(", ")
	builder.WriteString("warranty_expires=")
	builder.WriteString(_m.WarrantyExpires.Format(time.ANSIC))
	builder.WriteString(", ")
	builder.WriteString("warranty_details=")
	builder.WriteString(_m.WarrantyDetails)
	builder.WriteString(", ")
	builder.WriteString("purchase_date=")
	builder.WriteString(_m.PurchaseDate.Format(time.ANSIC))
	builder.WriteString(", ")
	builder.WriteString("purchase_from=")
	builder.WriteString(_m.PurchaseFrom)
	builder.WriteString(", ")
	builder.WriteString("purchase_price=")
	builder.WriteString(fmt.Sprintf("%v", _m.PurchasePrice))
	builder.WriteString(", ")
	builder.WriteString("sold_date=")
	builder.WriteString(_m.SoldDate.Format(time.ANSIC))
	builder.WriteString(", ")
	builder.WriteString("sold_to=")
	builder.WriteString(_m.SoldTo)
	builder.WriteString(", ")
	builder.WriteString("sold_price=")
	builder.WriteString(fmt.Sprintf("%v", _m.SoldPrice))
	builder.WriteString(", ")
	builder.WriteString("sold_notes=")
	builder.WriteString(_m.SoldNotes)
	builder.WriteByte(')')
	return builder.String()
}

// Entities is a parsable slice of Entity.
type Entities []*Entity