Skip to main content
Version: 4.4

Class: MetadataDiscovery#

core.MetadataDiscovery

Hierarchy#

  • MetadataDiscovery

Constructors#

constructor#

+ new MetadataDiscovery(metadata: MetadataStorage, platform: Platform, config: Configuration<IDatabaseDriver<Connection>>): MetadataDiscovery

Parameters:#

NameType
metadataMetadataStorage
platformPlatform
configConfiguration<IDatabaseDriver<Connection>>

Returns: MetadataDiscovery

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:24

Properties#

cache#

Private Readonly cache: CacheAdapter

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:20


discovered#

Private Readonly discovered: EntityMetadata<any>[]

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:24


logger#

Private Readonly logger: Logger

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:21


metadataProvider#

Private Readonly metadataProvider: MetadataProvider

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:19


namingStrategy#

Private Readonly namingStrategy: NamingStrategy

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:18


schemaHelper#

Private Readonly schemaHelper: undefined | { getTypeDefinition: (prop: EntityProperty<any>, types?: Dictionary<string[]>, lengths?: Dictionary<number>, allowZero?: boolean) => string }

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:22


validator#

Private Readonly validator: MetadataValidator

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:23

Methods#

applyNamingStrategy#

PrivateapplyNamingStrategy(meta: EntityMetadata<any>, prop: EntityProperty<any>): void

Parameters:#

NameType
metaEntityMetadata<any>
propEntityProperty<any>

Returns: void

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:250


autoWireBidirectionalProperties#

PrivateautoWireBidirectionalProperties(meta: EntityMetadata<any>): void

Parameters:#

NameType
metaEntityMetadata<any>

Returns: void

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:505


createDiscriminatorProperty#

PrivatecreateDiscriminatorProperty(meta: EntityMetadata<any>): void

Parameters:#

NameType
metaEntityMetadata<any>

Returns: void

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:663


defineBaseEntityProperties#

PrivatedefineBaseEntityProperties(meta: EntityMetadata<any>): number

Parameters:#

NameType
metaEntityMetadata<any>

Returns: number

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:518


defineFixedOrderProperty#

PrivatedefineFixedOrderProperty(prop: EntityProperty<any>): EntityProperty<any>

Parameters:#

NameType
propEntityProperty<any>

Returns: EntityProperty<any>

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:440


definePivotProperty#

PrivatedefinePivotProperty(prop: EntityProperty<any>, name: string, type: string, inverse: string, owner: boolean): EntityProperty<any>

Parameters:#

NameType
propEntityProperty<any>
namestring
typestring
inversestring
ownerboolean

Returns: EntityProperty<any>

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:463


definePivotTableEntity#

PrivatedefinePivotTableEntity(meta: EntityMetadata<any>, prop: EntityProperty<any>): EntityMetadata<any>

Parameters:#

NameType
metaEntityMetadata<any>
propEntityProperty<any>

Returns: EntityMetadata<any>

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:405


discover#

discover(preferTsNode?: boolean): Promise<MetadataStorage>

Parameters:#

NameTypeDefault value
preferTsNodebooleantrue

Returns: Promise<MetadataStorage>

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


discoverDirectories#

PrivatediscoverDirectories(paths: string[]): Promise<void>

Parameters:#

NameType
pathsstring[]

Returns: Promise<void>

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


discoverEntity#

PrivatediscoverEntity<T>(entity: EntityClass<T> | EntityClassGroup<T> | EntitySchema<T, undefined>, path?: string): Promise<void>

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
entityEntityClass<T> | EntityClassGroup<T> | EntitySchema<T, undefined>
path?string

Returns: Promise<void>

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:202


discoverReferences#

PrivatediscoverReferences(refs: Constructor<AnyEntity<any>>[]): Promise<void>

Parameters:#

NameType
refsConstructor<AnyEntity<any>>[]

Returns: Promise<void>

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:148


findEntities#

PrivatefindEntities(preferTsNode: boolean): Promise<EntityMetadata<any>[]>

Parameters:#

NameType
preferTsNodeboolean

Returns: Promise<EntityMetadata<any>[]>

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:68


getDefaultVersionValue#

PrivategetDefaultVersionValue(prop: EntityProperty<any>): string

Parameters:#

NameType
propEntityProperty<any>

Returns: string

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:673


getEntityClassOrSchema#

PrivategetEntityClassOrSchema(path: string, name: string): any[]

Parameters:#

NameType
pathstring
namestring

Returns: any[]

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:822


getSchema#

PrivategetSchema<T>(entity: Constructor<T> | EntitySchema<T, undefined>): EntitySchema<T, undefined>

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
entityConstructor<T> | EntitySchema<T, undefined>

Returns: EntitySchema<T, undefined>

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:179


initColumnType#

PrivateinitColumnType(prop: EntityProperty<any>, path?: string): void

Parameters:#

NameType
propEntityProperty<any>
path?string

Returns: void

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:755


initCustomType#

PrivateinitCustomType(prop: EntityProperty<any>): void

Parameters:#

NameType
propEntityProperty<any>

Returns: void

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:709


initDefaultValue#

PrivateinitDefaultValue(prop: EntityProperty<any>): void

Parameters:#

NameType
propEntityProperty<any>

Returns: void

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:686


initEmbeddables#

PrivateinitEmbeddables(meta: EntityMetadata<any>, embeddedProp: EntityProperty<any>, visited?: WeakSet<EntityProperty<any>>): void

Parameters:#

NameTypeDefault value
metaEntityMetadata<any>-
embeddedPropEntityProperty<any>-
visitedWeakSet<EntityProperty<any>>...

Returns: void

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:558


initEnumValues#

PrivateinitEnumValues(prop: EntityProperty<any>, path: string): void

Parameters:#

NameType
propEntityProperty<any>
pathstring

Returns: void

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:793


initFactoryField#

PrivateinitFactoryField<T>(prop: EntityProperty<T>): void

Type parameters:#

Name
T

Parameters:#

NameType
propEntityProperty<T>

Returns: void

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:394


initFieldName#

PrivateinitFieldName(prop: EntityProperty<any>): void

Parameters:#

NameType
propEntityProperty<any>

Returns: void

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:268


initManyToManyFieldName#

PrivateinitManyToManyFieldName(prop: EntityProperty<any>, name: string): string[]

Parameters:#

NameType
propEntityProperty<any>
namestring

Returns: string[]

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:297


initManyToManyFields#

PrivateinitManyToManyFields(meta: EntityMetadata<any>, prop: EntityProperty<any>): void

Parameters:#

NameType
metaEntityMetadata<any>
propEntityProperty<any>

Returns: void

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:302


initManyToOneFieldName#

PrivateinitManyToOneFieldName(prop: EntityProperty<any>, name: string): string[]

Parameters:#

NameType
propEntityProperty<any>
namestring

Returns: string[]

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:282


initManyToOneFields#

PrivateinitManyToOneFields(prop: EntityProperty<any>): void

Parameters:#

NameType
propEntityProperty<any>

Returns: void

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:332


initOneToManyFields#

PrivateinitOneToManyFields(prop: EntityProperty<any>): void

Parameters:#

NameType
propEntityProperty<any>

Returns: void

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:346


initRelation#

PrivateinitRelation(prop: EntityProperty<any>): void

Parameters:#

NameType
propEntityProperty<any>

Returns: void

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:745


initSingleTableInheritance#

PrivateinitSingleTableInheritance(meta: EntityMetadata<any>, metadata: EntityMetadata<any>[]): void

Parameters:#

NameType
metaEntityMetadata<any>
metadataEntityMetadata<any>[]

Returns: void

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:613


initUnsigned#

PrivateinitUnsigned(prop: EntityProperty<any>): void

Parameters:#

NameType
propEntityProperty<any>

Returns: void

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:807


initVersionProperty#

PrivateinitVersionProperty(meta: EntityMetadata<any>, prop: EntityProperty<any>): void

Parameters:#

NameType
metaEntityMetadata<any>
propEntityProperty<any>

Returns: void

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:700


prepare#

Privateprepare<T>(entity: EntityClass<T> | EntityClassGroup<T> | EntitySchema<T, undefined>): EntityClass<T> | EntitySchema<T, undefined>

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
entityEntityClass<T> | EntityClassGroup<T> | EntitySchema<T, undefined>

Returns: EntityClass<T> | EntitySchema<T, undefined>

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:163


processEntity#

PrivateprocessEntity(meta: EntityMetadata<any>): EntityMetadata<any>[]

Parameters:#

NameType
metaEntityMetadata<any>

Returns: EntityMetadata<any>[]

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:359


saveToCache#

PrivatesaveToCache<T>(meta: EntityMetadata<any>): Promise<void>

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata<any>

Returns: Promise<void>

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:236


shouldForceConstructorUsage#

PrivateshouldForceConstructorUsage<T>(meta: EntityMetadata<T>): boolean

Type parameters:#

Name
T

Parameters:#

NameType
metaEntityMetadata<T>

Returns: boolean

Defined in: packages/core/src/metadata/MetadataDiscovery.ts:853

Last updated on by renovate[bot]