Version: 4.3

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

Parameters:#

NameType
metaEntityMetadata
propEntityProperty

Returns: void


autoWireBidirectionalProperties#

PrivateautoWireBidirectionalProperties(meta: EntityMetadata): void

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

Parameters:#

NameType
metaEntityMetadata

Returns: void


createDiscriminatorProperty#

PrivatecreateDiscriminatorProperty(meta: EntityMetadata): void

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

Parameters:#

NameType
metaEntityMetadata

Returns: void


defineBaseEntityProperties#

PrivatedefineBaseEntityProperties(meta: EntityMetadata): number

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

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

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

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

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

Parameters:#

NameType
refsConstructor<AnyEntity>[]

Returns: Promise<void>


findEntities#

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

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

Parameters:#

NameType
preferTsNodeboolean

Returns: Promise<EntityMetadata[]>


getDefaultVersionValue#

PrivategetDefaultVersionValue(prop: EntityProperty): string

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

Parameters:#

NameType
propEntityProperty

Returns: string


getEntityClassOrSchema#

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

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

Parameters:#

NameType
pathstring
namestring

Returns: any[]


getSchema#

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

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

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

Parameters:#

NameType
propEntityProperty
path?string

Returns: void


initCustomType#

PrivateinitCustomType(prop: EntityProperty): void

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

Parameters:#

NameType
propEntityProperty

Returns: void


initDefaultValue#

PrivateinitDefaultValue(prop: EntityProperty): void

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

Parameters:#

NameType
propEntityProperty

Returns: void


initEmbeddables#

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

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

Parameters:#

NameType
metaEntityMetadata
embeddedPropEntityProperty

Returns: void


initEnumValues#

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

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

Parameters:#

NameType
propEntityProperty
pathstring

Returns: void


initFactoryField#

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

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

Type parameters:#

Name
T

Parameters:#

NameType
propEntityProperty<T>

Returns: void


initFieldName#

PrivateinitFieldName(prop: EntityProperty): void

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

Parameters:#

NameType
propEntityProperty

Returns: void


initManyToManyFieldName#

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

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

Parameters:#

NameType
propEntityProperty
namestring

Returns: string[]


initManyToManyFields#

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

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

Parameters:#

NameType
metaEntityMetadata
propEntityProperty

Returns: void


initManyToOneFieldName#

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

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

Parameters:#

NameType
propEntityProperty
namestring

Returns: string[]


initManyToOneFields#

PrivateinitManyToOneFields(prop: EntityProperty): void

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

Parameters:#

NameType
propEntityProperty

Returns: void


initOneToManyFields#

PrivateinitOneToManyFields(prop: EntityProperty): void

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

Parameters:#

NameType
propEntityProperty

Returns: void


initRelation#

PrivateinitRelation(prop: EntityProperty): void

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

Parameters:#

NameType
propEntityProperty

Returns: void


initSingleTableInheritance#

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

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

Parameters:#

NameType
metaEntityMetadata
metadataEntityMetadata[]

Returns: void


initUnsigned#

PrivateinitUnsigned(prop: EntityProperty): void

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

Parameters:#

NameType
propEntityProperty

Returns: void


initVersionProperty#

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

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

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

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

Parameters:#

NameType
metaEntityMetadata

Returns: EntityMetadata[]


saveToCache#

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

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

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata

Returns: Promise<void>

Last updated on by Renovate Bot