Skip to main content
Version: Next

EntityMetadataWithProperties <TName, TTableName, TProperties, TPK, TBase, TRepository>

Hierarchy

  • Omit<Partial<EntityMetadata<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>>>, properties | extends | primaryKeys | hooks | discriminatorColumn | versionProperty | concurrencyCheckKeys | serializedPrimaryKey | indexes | uniques | repository | orderBy>
    • EntityMetadataWithProperties

Index

Properties

optionalinheritedabstract

abstract?: boolean

optionalinheritedallTPTDescendants

allTPTDescendants?: EntityMetadata<any, EntityCtor<any>>[]

For TPT: all non-abstract descendants, sorted by depth (deepest first). Precomputed during discovery.

optionalinheritedbidirectionalRelations

bidirectionalRelations?: EntityProperty<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>, any>[]

optionalinheritedchecks

checks?: CheckConstraint<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>>[]

optionalinheritedclass

class?: EntityCtor<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>>

optionalinheritedclassName

className?: string

optionalinheritedcollection

collection?: string

optionalinheritedcomment

comment?: string

optionalinheritedcomparableProps

comparableProps?: EntityProperty<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>, any>[]

optionalinheritedcompositePK

compositePK?: boolean

optionalconcurrencyCheckKeys

concurrencyCheckKeys?: Set<AllKeys<TProperties, TBase>>

optionalinheritedconstructorParams

constructorParams?: (typeof PrimaryKeyProp | keyof TProperties | keyof IsNever<TRepository, true, false> extends true ? {} : { [EntityRepositoryType]?: TRepository extends Constructor<R> ? R : TRepository } | keyof IsNever<TBase, true, false> extends true ? {} : Omit<TBase, typeof PrimaryKeyProp>)[]

optionalinheriteddefinedProperties

definedProperties?: Dictionary<any>

optionaldiscriminatorColumn

discriminatorColumn?: string

optionalinheriteddiscriminatorMap

discriminatorMap?: Dictionary<EntityClass<any>>

optionalinheriteddiscriminatorValue

discriminatorValue?: string | number

optionalinheritedembeddable

embeddable?: boolean

optionalinheritedexpression

expression?: string | (em, where, options, stream) => MaybePromise<string | object | RawQueryFragment<string>>

optionalextends

extends?: { ~entity: TBase } | EntityCtor<TBase>

optionalinheritedfilters

filters?: Dictionary<FilterDef<any>>

optionalinheritedforceConstructor

forceConstructor?: boolean

optionalinheritedgetterProps

getterProps?: EntityProperty<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>, any>[]

optionalinheritedhasTriggers

hasTriggers?: boolean

optionalinheritedhasUniqueProps

hasUniqueProps?: boolean

optionalhooks

hooks?: DefineEntityHooks<any>

optionalinheritedhydrateProps

hydrateProps?: EntityProperty<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>, any>[]

optionalindexes

indexes?: { expression?: string | IndexCallback<InferEntityFromProperties<TProperties, TPK, TBase, never>>; name?: string; options?: Dictionary; properties?: keyof TProperties | keyof TProperties[]; type?: string }[]

optionalinheritance

inheritance?: tpt

optionalinheritedinheritanceType

inheritanceType?: sti | tpt

Inheritance type: 'sti' (Single Table Inheritance) or 'tpt' (Table-Per-Type). Only set on root entities.

optionalinheritedmaterialized

materialized?: boolean

True if this is a materialized view (PostgreSQL only). Requires view: true.

name

name: TName

optionalorderBy

orderBy?: { [ K in string ]?: QueryOrderKeysFlat } | { [ K in string ]?: QueryOrderKeysFlat }[]

optionalinheritedownProps

ownProps?: EntityProperty<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>, any>[]

For TPT: properties defined only in THIS entity (not inherited from parent).

optionalinheritedpath

path?: string

optionalinheritedpivotTable

pivotTable?: boolean

optionalinheritedpolymorphicDiscriminatorMap

polymorphicDiscriminatorMap?: Dictionary<EntityClass<any>>

For polymorphic M:N pivot tables, maps discriminator values to entity classes

optionalinheritedpolymorphs

polymorphs?: EntityMetadata<any, EntityCtor<any>>[]

optionalprimaryKeys

primaryKeys?: TPK & InferPrimaryKey<TProperties>[]

properties

properties: TProperties | (properties) => TProperties

optionalreadonlyinheritedpropertyOrder

propertyOrder?: Map<string, number> = ...

optionalinheritedprops

props?: EntityProperty<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>, any>[]

optionalinheritedprototype

prototype?: InferEntityFromProperties<TProperties, TPK, TBase, TRepository>

optionalinheritedreadonly

readonly?: boolean

optionalinheritedreferencingProperties

referencingProperties?: { meta: EntityMetadata<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>, EntityCtor<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>>>; prop: EntityProperty<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>, any> }[]

optionalinheritedrelations

relations?: EntityProperty<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>, any>[]

optionalrepository

repository?: () => TRepository

Type declaration

    • (): TRepository
    • Returns TRepository

optionalinheritedrepositoryClass

repositoryClass?: string

optionalinheritedroot

root?: EntityMetadata<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>, EntityCtor<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>>>

optionalinheritedschema

schema?: string

optionalinheritedselfReferencing

selfReferencing?: boolean

optionalserializedPrimaryKey

serializedPrimaryKey?: AllKeys<TProperties, TBase>

optionalinheritedsimplePK

simplePK?: boolean

optionaltableName

tableName?: TTableName

optionalinheritedtptChildren

tptChildren?: EntityMetadata<any, EntityCtor<any>>[]

For TPT: direct child entities (entities that extend this one).

optionalinheritedtptDiscriminatorColumn

tptDiscriminatorColumn?: string

For TPT: virtual discriminator property name (computed at query time, not persisted).

optionalinheritedtptInverseProp

tptInverseProp?: EntityProperty<any, any>

For TPT: inverse of tptParentProp, used for joining from parent to child (parent PK → child PK).

optionalinheritedtptParent

tptParent?: EntityMetadata<any, EntityCtor<any>>

For TPT: direct parent entity metadata (the entity this one extends).

optionalinheritedtptParentProp

tptParentProp?: EntityProperty<any, any>

For TPT: synthetic property representing the join to the parent table (child PK → parent PK).

optionalinheritedtrackingProps

trackingProps?: EntityProperty<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>, any>[]

inheriteduniqueName

uniqueName: undefined | string

optionalinheriteduniqueProps

uniqueProps?: EntityProperty<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>, any>[]

optionaluniques

uniques?: { deferMode?: DeferMode | immediate | deferred; expression?: string | IndexCallback<InferEntityFromProperties<TProperties, TPK, TBase, never>>; name?: string; options?: Dictionary; properties?: keyof TProperties | keyof TProperties[] }[]

optionalinheritedvalidateProps

validateProps?: EntityProperty<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>, any>[]

optionalversionProperty

versionProperty?: AllKeys<TProperties, TBase>

optionalinheritedview

view?: boolean | { materialized?: boolean; withData?: boolean }

True if this entity represents a database view (not a virtual entity). Accepts { materialized: true } as input, normalized to true during sync.

optionalinheritedvirtual

virtual?: boolean

optionalinheritedwithData

withData?: boolean

For materialized views, whether data is populated on creation. Defaults to true.

Methods

optionalinheritedaddProperty

  • addProperty(prop): void

optionalinheritedcreateColumnMappingObject

  • createColumnMappingObject(alias, toStringAlias): FormulaColumns<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>>
  • Creates a mapping from property names to field names.


    Parameters

    • optionalalias: string | (prop) => string

      Optional alias to prefix field names. Can be a string (same for all) or a function (per-property). When provided, also adds toString() returning the alias for backwards compatibility with formulas.

      • optionaltoStringAlias: string

        Optional alias to return from toString(). Defaults to alias when it's a string.

      Returns FormulaColumns<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>>

    optionalinheritedcreateSchemaColumnMappingObject

    • Creates a column mapping for schema callbacks (indexes, checks, generated columns). For TPT entities, only includes properties that belong to the current table (ownProps).


      Returns SchemaColumns<InferEntityFromProperties<TProperties, TPK, TBase, TRepository>>

    optionalinheritedgetPrimaryProp

    optionalinheritedgetPrimaryProps

    optionalinheritedremoveProperty

    • removeProperty(name, sync): void
    • Parameters

      • name: string
      • sync: boolean = true

      Returns void

    optionalinheritedsync

    • sync(initIndexes, config): void