Version: 4.2

Class: EntitySchema<T, U>

Type parameters#

NameTypeDefault
TAnyEntity<T>AnyEntity
UAnyEntity<U> | undefinedundefined

Hierarchy#

  • EntitySchema

Constructors#

constructor#

+ new EntitySchema(meta: Metadata<T, U>): EntitySchema

Defined in packages/core/src/metadata/EntitySchema.ts:32

Parameters:#

NameType
metaMetadata<T, U>

Returns: EntitySchema

Properties#

_meta#

Private Readonly _meta: EntityMetadata<T> = new EntityMetadata<T>()

Defined in packages/core/src/metadata/EntitySchema.ts:30


initialized#

Private initialized: boolean = false

Defined in packages/core/src/metadata/EntitySchema.ts:32


internal#

Private internal: boolean = false

Defined in packages/core/src/metadata/EntitySchema.ts:31

Accessors#

meta#

• get meta(): EntityMetadata<T>

Defined in packages/core/src/metadata/EntitySchema.ts:206

Returns: EntityMetadata<T>


name#

• get name(): EntityName<T>

Defined in packages/core/src/metadata/EntitySchema.ts:210

Returns: EntityName<T>

Methods#

addEmbedded#

addEmbedded<K>(name: string & keyof T, options: EmbeddedOptions): void

Defined in packages/core/src/metadata/EntitySchema.ts:112

Type parameters:#

NameDefault
Kunknown

Parameters:#

NameType
namestring & keyof T
optionsEmbeddedOptions

Returns: void


addEnum#

addEnum(name: string & keyof T, type?: TypeType, options?: EnumOptions<T>): void

Defined in packages/core/src/metadata/EntitySchema.ts:84

Parameters:#

NameTypeDefault value
namestring & keyof T-
type?TypeType-
optionsEnumOptions<T>{}

Returns: void


addIndex#

addIndex<T>(options: Required<Omit<IndexOptions<T>, "name" | "type" | "options">> & { name?: string ; options?: Dictionary ; type?: string }): void

Defined in packages/core/src/metadata/EntitySchema.ts:178

Type parameters:#

Name
T

Parameters:#

NameType
optionsRequired<Omit<IndexOptions<T>, "name" | "type" | "options">> & { name?: string ; options?: Dictionary ; type?: string }

Returns: void


addManyToMany#

addManyToMany<K>(name: string & keyof T, type: TypeType, options: ManyToManyOptions<K, T>): void

Defined in packages/core/src/metadata/EntitySchema.ts:137

Type parameters:#

NameDefault
Kunknown

Parameters:#

NameType
namestring & keyof T
typeTypeType
optionsManyToManyOptions<K, T>

Returns: void


addManyToOne#

addManyToOne<K>(name: string & keyof T, type: TypeType, options: ManyToOneOptions<K, T>): void

Defined in packages/core/src/metadata/EntitySchema.ts:122

Type parameters:#

NameDefault
Kunknown

Parameters:#

NameType
namestring & keyof T
typeTypeType
optionsManyToOneOptions<K, T>

Returns: void


addOneToMany#

addOneToMany<K>(name: string & keyof T, type: TypeType, options: OneToManyOptions<K, T>): void

Defined in packages/core/src/metadata/EntitySchema.ts:152

Type parameters:#

NameDefault
Kunknown

Parameters:#

NameType
namestring & keyof T
typeTypeType
optionsOneToManyOptions<K, T>

Returns: void


addOneToOne#

addOneToOne<K>(name: string & keyof T, type: TypeType, options: OneToOneOptions<K, T>): void

Defined in packages/core/src/metadata/EntitySchema.ts:157

Type parameters:#

NameDefault
Kunknown

Parameters:#

NameType
namestring & keyof T
typeTypeType
optionsOneToOneOptions<K, T>

Returns: void


addPrimaryKey#

addPrimaryKey(name: string & keyof T, type: TypeType, options?: PrimaryKeyOptions<T>): void

Defined in packages/core/src/metadata/EntitySchema.ts:103

Parameters:#

NameTypeDefault value
namestring & keyof T-
typeTypeType-
optionsPrimaryKeyOptions<T>{}

Returns: void


addProperty#

addProperty(name: string & keyof T, type?: TypeType, options?: PropertyOptions<T> | EntityProperty): void

Defined in packages/core/src/metadata/EntitySchema.ts:52

Parameters:#

NameTypeDefault value
namestring & keyof T-
type?TypeType-
optionsPropertyOptions<T> | EntityProperty{}

Returns: void


addSerializedPrimaryKey#

addSerializedPrimaryKey(name: string & keyof T, type: TypeType, options?: SerializedPrimaryKeyOptions<T>): void

Defined in packages/core/src/metadata/EntitySchema.ts:107

Parameters:#

NameTypeDefault value
namestring & keyof T-
typeTypeType-
optionsSerializedPrimaryKeyOptions<T>{}

Returns: void


addUnique#

addUnique<T>(options: Required<Omit<UniqueOptions<T>, "name" | "options">> & { name?: string ; options?: Dictionary }): void

Defined in packages/core/src/metadata/EntitySchema.ts:182

Type parameters:#

Name
T

Parameters:#

NameType
optionsRequired<Omit<UniqueOptions<T>, "name" | "options">> & { name?: string ; options?: Dictionary }

Returns: void


addVersion#

addVersion(name: string & keyof T, type: TypeType, options?: PropertyOptions<T>): void

Defined in packages/core/src/metadata/EntitySchema.ts:99

Parameters:#

NameTypeDefault value
namestring & keyof T-
typeTypeType-
optionsPropertyOptions<T>{}

Returns: void


createProperty#

PrivatecreateProperty<T>(reference: ReferenceType, options: PropertyOptions<T> | EntityProperty): { cascade: Cascade[] = [Cascade.PERSIST]; reference: ReferenceType } | { cascade: Cascade[] = [Cascade.PERSIST]; reference: ReferenceType }

Defined in packages/core/src/metadata/EntitySchema.ts:318

Type parameters:#

Name
T

Parameters:#

NameType
referenceReferenceType
optionsPropertyOptions<T> | EntityProperty

Returns: { cascade: Cascade[] = [Cascade.PERSIST]; reference: ReferenceType } | { cascade: Cascade[] = [Cascade.PERSIST]; reference: ReferenceType }


init#

init(): this

Defined in packages/core/src/metadata/EntitySchema.ts:217

internal

Returns: this


initPrimaryKeys#

PrivateinitPrimaryKeys(): void

Defined in packages/core/src/metadata/EntitySchema.ts:278

Returns: void


initProperties#

PrivateinitProperties(): void

Defined in packages/core/src/metadata/EntitySchema.ts:242

Returns: void


normalizeType#

PrivatenormalizeType(options: PropertyOptions<T> | EntityProperty, type?: string | any | Constructor<Type>): any

Defined in packages/core/src/metadata/EntitySchema.ts:298

Parameters:#

NameType
optionsPropertyOptions<T> | EntityProperty
type?string | any | Constructor<Type>

Returns: any


setClass#

setClass(proto: Constructor<T>): void

Defined in packages/core/src/metadata/EntitySchema.ts:194

Parameters:#

NameType
protoConstructor<T>

Returns: void


setCustomRepository#

setCustomRepository(repository: () => Constructor<EntityRepository<T>>): void

Defined in packages/core/src/metadata/EntitySchema.ts:186

Parameters:#

NameType
repository() => Constructor<EntityRepository<T>>

Returns: void


setExtends#

setExtends(base: string): void

Defined in packages/core/src/metadata/EntitySchema.ts:190

Parameters:#

NameType
basestring

Returns: void


fromMetadata#

StaticfromMetadata<T, U>(meta: EntityMetadata<T> | DeepPartial<EntityMetadata<T>>): EntitySchema<T, U>

Defined in packages/core/src/metadata/EntitySchema.ts:45

Type parameters:#

NameTypeDefault
TAnyEntity<T>AnyEntity
UAnyEntity<U> | undefinedundefined

Parameters:#

NameType
metaEntityMetadata<T> | DeepPartial<EntityMetadata<T>>

Returns: EntitySchema<T, U>

Last updated on by Renovate Bot