Version: 4.2

Class: MetadataDiscovery

Hierarchy#

  • MetadataDiscovery

Constructors#

constructor#

+ new MetadataDiscovery(metadata: MetadataStorage, platform: Platform, config: Configuration): MetadataDiscovery

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

Parameters:#

NameType
metadataMetadataStorage
platformPlatform
configConfiguration

Returns: MetadataDiscovery

Properties#

cache#

Private Readonly cache: CacheAdapter = this.config.getCacheAdapter()

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


config#

Private Readonly config: Configuration

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


discovered#

Private Readonly discovered: EntityMetadata[] = []

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


logger#

Private Readonly logger: Logger = this.config.getLogger()

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


metadata#

Private Readonly metadata: MetadataStorage

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


metadataProvider#

Private Readonly metadataProvider: MetadataProvider = this.config.getMetadataProvider()

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


namingStrategy#

Private Readonly namingStrategy: NamingStrategy = this.config.getNamingStrategy()

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


platform#

Private Readonly platform: Platform

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


schemaHelper#

Private Readonly schemaHelper: { getTypeDefinition: (prop: EntityProperty, types?: Dictionary<string[]>, lengths?: Dictionary<number>, allowZero?: boolean) => string } = this.platform.getSchemaHelper()

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

Type declaration:#

NameType
getTypeDefinition(prop: EntityProperty, types?: Dictionary<string[]>, lengths?: Dictionary<number>, allowZero?: boolean) => string

validator#

Private Readonly validator: MetadataValidator = new MetadataValidator()

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

Methods#

applyNamingStrategy#

PrivateapplyNamingStrategy(meta: EntityMetadata, prop: EntityProperty): void

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

Parameters:#

NameType
metaEntityMetadata
propEntityProperty

Returns: void


autoWireBidirectionalProperties#

PrivateautoWireBidirectionalProperties(meta: EntityMetadata): void

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

Parameters:#

NameType
metaEntityMetadata

Returns: void


createDiscriminatorProperty#

PrivatecreateDiscriminatorProperty(meta: EntityMetadata): void

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

Parameters:#

NameType
metaEntityMetadata

Returns: void


defineBaseEntityProperties#

PrivatedefineBaseEntityProperties(meta: EntityMetadata): number

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

Parameters:#

NameType
metaEntityMetadata

Returns: number


defineFixedOrderProperty#

PrivatedefineFixedOrderProperty(prop: EntityProperty): EntityProperty

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

Parameters:#

NameType
propEntityProperty

Returns: EntityProperty


definePivotProperty#

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

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

Parameters:#

NameType
propEntityProperty
namestring
typestring
inversestring
ownerboolean

Returns: EntityProperty


definePivotTableEntity#

PrivatedefinePivotTableEntity(meta: EntityMetadata, prop: EntityProperty): EntityMetadata

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

Parameters:#

NameType
metaEntityMetadata
propEntityProperty

Returns: EntityMetadata


discover#

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

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

Parameters:#

NameTypeDefault value
preferTsNodebooleantrue

Returns: Promise<MetadataStorage>


discoverDirectories#

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

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

Parameters:#

NameType
pathsstring[]

Returns: Promise<void>


discoverEntity#

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

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

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

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

Returns: Promise<void>


discoverReferences#

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

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

Parameters:#

NameType
refsConstructor<AnyEntity>[]

Returns: Promise<void>


findEntities#

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

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

Parameters:#

NameType
preferTsNodeboolean

Returns: Promise<EntityMetadata[]>


getDefaultVersionValue#

PrivategetDefaultVersionValue(prop: EntityProperty): string

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

Parameters:#

NameType
propEntityProperty

Returns: string


getEntityClassOrSchema#

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

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

Parameters:#

NameType
pathstring
namestring

Returns: any[]


getSchema#

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

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

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
entityConstructor<T> | EntitySchema<T>

Returns: EntitySchema<T>


initColumnType#

PrivateinitColumnType(prop: EntityProperty, path?: string): void

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

Parameters:#

NameType
propEntityProperty
path?string

Returns: void


initCustomType#

PrivateinitCustomType(prop: EntityProperty): void

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

Parameters:#

NameType
propEntityProperty

Returns: void


initDefaultValue#

PrivateinitDefaultValue(prop: EntityProperty): void

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

Parameters:#

NameType
propEntityProperty

Returns: void


initEmbeddables#

PrivateinitEmbeddables(meta: EntityMetadata, embeddedProp: EntityProperty): void

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

Parameters:#

NameType
metaEntityMetadata
embeddedPropEntityProperty

Returns: void


initEnumValues#

PrivateinitEnumValues(prop: EntityProperty, path: string): void

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

Parameters:#

NameType
propEntityProperty
pathstring

Returns: void


initFactoryField#

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

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

Type parameters:#

Name
T

Parameters:#

NameType
propEntityProperty<T>

Returns: void


initFieldName#

PrivateinitFieldName(prop: EntityProperty): void

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

Parameters:#

NameType
propEntityProperty

Returns: void


initManyToManyFieldName#

PrivateinitManyToManyFieldName(prop: EntityProperty, name: string): string[]

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

Parameters:#

NameType
propEntityProperty
namestring

Returns: string[]


initManyToManyFields#

PrivateinitManyToManyFields(meta: EntityMetadata, prop: EntityProperty): void

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

Parameters:#

NameType
metaEntityMetadata
propEntityProperty

Returns: void


initManyToOneFieldName#

PrivateinitManyToOneFieldName(prop: EntityProperty, name: string): string[]

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

Parameters:#

NameType
propEntityProperty
namestring

Returns: string[]


initManyToOneFields#

PrivateinitManyToOneFields(prop: EntityProperty): void

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

Parameters:#

NameType
propEntityProperty

Returns: void


initOneToManyFields#

PrivateinitOneToManyFields(prop: EntityProperty): void

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

Parameters:#

NameType
propEntityProperty

Returns: void


initSingleTableInheritance#

PrivateinitSingleTableInheritance(meta: EntityMetadata, metadata: EntityMetadata[]): void

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

Parameters:#

NameType
metaEntityMetadata
metadataEntityMetadata[]

Returns: void


initUnsigned#

PrivateinitUnsigned(prop: EntityProperty): void

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

Parameters:#

NameType
propEntityProperty

Returns: void


initVersionProperty#

PrivateinitVersionProperty(meta: EntityMetadata, prop: EntityProperty): void

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

Parameters:#

NameType
metaEntityMetadata
propEntityProperty

Returns: void


prepare#

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

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

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

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

Returns: EntityClass<T> | EntitySchema<T>


processEntity#

PrivateprocessEntity(meta: EntityMetadata): EntityMetadata[]

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

Parameters:#

NameType
metaEntityMetadata

Returns: EntityMetadata[]


saveToCache#

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

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

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata

Returns: Promise<void>

Last updated on by Renovate Bot