Version: 4.3

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:207

Returns: EntityMetadata<T>


name

• get name(): EntityName<T>

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

Returns: EntityName<T>

Methods

addEmbedded

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

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

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:85

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:179

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:138

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:123

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:153

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:158

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:104

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:53

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:108

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:183

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:100

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:319

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:218

internal

Returns: this


initPrimaryKeys

PrivateinitPrimaryKeys(): void

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

Returns: void


initProperties

PrivateinitProperties(): void

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

Returns: void


normalizeType

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

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

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:195

Parameters:

NameType
protoConstructor<T>

Returns: void


setCustomRepository

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

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

Parameters:

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

Returns: void


setExtends

setExtends(base: string): void

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

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:46

Type parameters:

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

Parameters:

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

Returns: EntitySchema<T, U>

Last updated on by Martin Adámek