Skip to main content
Version: 4.4

Class: MetadataError<T>#

core.MetadataError

Type parameters#

NameTypeDefault
TAnyEntityAnyEntity

Hierarchy#

Constructors#

constructor#

+ new MetadataError<T>(message: string, entity?: T): MetadataError<T>

Type parameters:#

NameTypeDefault
TAnyEntity<any>AnyEntity<any\>

Parameters:#

NameType
messagestring
entity?T

Returns: MetadataError<T>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:4

Properties#

message#

message: string

Inherited from: ValidationError.message

Defined in: docs/node_modules/typescript/lib/lib.es5.d.ts:974


name#

name: string

Inherited from: ValidationError.name

Defined in: docs/node_modules/typescript/lib/lib.es5.d.ts:973


prepareStackTrace#

Optional prepareStackTrace: undefined | (err: Error, stackTraces: CallSite[]) => any

Optional override for formatting stack traces

see https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces

Inherited from: ValidationError.prepareStackTrace

Defined in: node_modules/@types/node/globals.d.ts:11


stack#

Optional stack: undefined | string

Inherited from: ValidationError.stack

Defined in: docs/node_modules/typescript/lib/lib.es5.d.ts:975


stackTraceLimit#

stackTraceLimit: number

Inherited from: ValidationError.stackTraceLimit

Defined in: node_modules/@types/node/globals.d.ts:13

Methods#

captureStackTrace#

captureStackTrace(targetObject: object, constructorOpt?: Function): void

Create .stack property on a target object

Parameters:#

NameType
targetObjectobject
constructorOpt?Function

Returns: void

Inherited from: ValidationError

Defined in: node_modules/@types/node/globals.d.ts:4


getEntity#

getEntity(): undefined | AnyEntity<any>

Gets instance of entity that caused this error.

Returns: undefined | AnyEntity<any>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:17


cannotCommit#

StaticcannotCommit(): ValidationError<AnyEntity<any>>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:92


cannotModifyInverseCollection#

StaticcannotModifyInverseCollection(owner: AnyEntity<any>, property: EntityProperty<any>): ValidationError<AnyEntity<any>>

Parameters:#

NameType
ownerAnyEntity<any>
propertyEntityProperty<any>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:79


cannotUseOperatorsInsideEmbeddables#

StaticcannotUseOperatorsInsideEmbeddables(className: string, propName: string, payload: Dictionary<any>): ValidationError<AnyEntity<any>>

Parameters:#

NameType
classNamestring
propNamestring
payloadDictionary<any>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:96


conflictingPropertyName#

StaticconflictingPropertyName(className: string, name: string, embeddedName: string): MetadataError<AnyEntity<any>>

Parameters:#

NameType
classNamestring
namestring
embeddedNamestring

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:199


duplicateEntityDiscovered#

StaticduplicateEntityDiscovered(paths: string[]): MetadataError<AnyEntity<any>>

Parameters:#

NameType
pathsstring[]

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:187


entityNotFound#

StaticentityNotFound(name: string, path: string): MetadataError<AnyEntity<any>>

Parameters:#

NameType
namestring
pathstring

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:158


entityNotManaged#

StaticentityNotManaged(entity: AnyEntity<any>): ValidationError<AnyEntity<any>>

Parameters:#

NameType
entityAnyEntity<any>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:43


fromCollectionNotInitialized#

StaticfromCollectionNotInitialized(entity: AnyEntity<any>, prop: EntityProperty<any>): ValidationError<AnyEntity<any>>

Parameters:#

NameType
entityAnyEntity<any>
propEntityProperty<any>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:28


fromMergeWithoutPK#

StaticfromMergeWithoutPK(meta: EntityMetadata<any>): void

Parameters:#

NameType
metaEntityMetadata<any>

Returns: void

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:35


fromMessage#

Private StaticfromMessage(meta: EntityMetadata<any>, prop: EntityProperty<any>, message: string): MetadataError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>
propEntityProperty<any>
messagestring

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:203


fromMissingPrimaryKey#

StaticfromMissingPrimaryKey(meta: EntityMetadata<any>): MetadataError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:130


fromUnknownEntity#

StaticfromUnknownEntity(className: string, source: string): MetadataError<AnyEntity<any>>

Parameters:#

NameType
classNamestring
sourcestring

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:175


fromWrongOwnership#

StaticfromWrongOwnership(meta: EntityMetadata<any>, prop: EntityProperty<any>, key: object | default | cascade | name | entity | type | targetMeta | columnTypes | customType | primary | serializedPrimaryKey | lazy | array | length | reference | wrappedReference | fieldNames | fieldNameRaw | defaultRaw | formula | prefix | embedded | embeddable | embeddedProps | index | unique | nullable | inherited | unsigned | mapToPk | persist | hidden | enum | items | version | eager | setter | getter | getterName | orphanRemoval | onCreate | onUpdate | onDelete | onUpdateIntegrity | strategy | owner | inversedBy | mappedBy | orderBy | fixedOrder | fixedOrderColumn | pivotTable | joinColumns | inverseJoinColumns | referencedColumnNames | referencedTableName | referencedPKs | serializer | serializedName | comment | userDefined): MetadataError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>
propEntityProperty<any>
keyobject | default | cascade | name | entity | type | targetMeta | columnTypes | customType | primary | serializedPrimaryKey | lazy | array | length | reference | wrappedReference | fieldNames | fieldNameRaw | defaultRaw | formula | prefix | embedded | embeddable | embeddedProps | index | unique | nullable | inherited | unsigned | mapToPk | persist | hidden | enum | items | version | eager | setter | getter | getterName | orphanRemoval | onCreate | onUpdate | onDelete | onUpdateIntegrity | strategy | owner | inversedBy | mappedBy | orderBy | fixedOrder | fixedOrderColumn | pivotTable | joinColumns | inverseJoinColumns | referencedColumnNames | referencedTableName | referencedPKs | serializer | serializedName | comment | userDefined

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:150


fromWrongPropertyType#

StaticfromWrongPropertyType(entity: AnyEntity<any>, property: string, expectedType: string, givenType: string, givenValue: string): ValidationError<AnyEntity<any>>

Parameters:#

NameType
entityAnyEntity<any>
propertystring
expectedTypestring
givenTypestring
givenValuestring

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:21


fromWrongReference#

StaticfromWrongReference(meta: EntityMetadata<any>, prop: EntityProperty<any>, key: object | default | cascade | name | entity | type | targetMeta | columnTypes | customType | primary | serializedPrimaryKey | lazy | array | length | reference | wrappedReference | fieldNames | fieldNameRaw | defaultRaw | formula | prefix | embedded | embeddable | embeddedProps | index | unique | nullable | inherited | unsigned | mapToPk | persist | hidden | enum | items | version | eager | setter | getter | getterName | orphanRemoval | onCreate | onUpdate | onDelete | onUpdateIntegrity | strategy | owner | inversedBy | mappedBy | orderBy | fixedOrder | fixedOrderColumn | pivotTable | joinColumns | inverseJoinColumns | referencedColumnNames | referencedTableName | referencedPKs | serializer | serializedName | comment | userDefined, owner?: EntityProperty<any>): MetadataError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>
propEntityProperty<any>
keyobject | default | cascade | name | entity | type | targetMeta | columnTypes | customType | primary | serializedPrimaryKey | lazy | array | length | reference | wrappedReference | fieldNames | fieldNameRaw | defaultRaw | formula | prefix | embedded | embeddable | embeddedProps | index | unique | nullable | inherited | unsigned | mapToPk | persist | hidden | enum | items | version | eager | setter | getter | getterName | orphanRemoval | onCreate | onUpdate | onDelete | onUpdateIntegrity | strategy | owner | inversedBy | mappedBy | orderBy | fixedOrder | fixedOrderColumn | pivotTable | joinColumns | inverseJoinColumns | referencedColumnNames | referencedTableName | referencedPKs | serializer | serializedName | comment | userDefined
owner?EntityProperty<any>

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:134


fromWrongTypeDefinition#

StaticfromWrongTypeDefinition(meta: EntityMetadata<any>, prop: EntityProperty<any>): MetadataError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>
propEntityProperty<any>

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:142


invalidCompositeIdentifier#

StaticinvalidCompositeIdentifier(meta: EntityMetadata<any>): ValidationError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:88


invalidEmbeddableQuery#

StaticinvalidEmbeddableQuery(className: string, propName: string, embeddableType: string): ValidationError<AnyEntity<any>>

Parameters:#

NameType
classNamestring
propNamestring
embeddableTypestring

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:100


invalidPropertyName#

StaticinvalidPropertyName(entityName: string, invalid: string): ValidationError<AnyEntity<any>>

Parameters:#

NameType
entityNamestring
invalidstring

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:65


invalidType#

StaticinvalidType(type: Constructor<any>, value: any, mode: string): ValidationError<AnyEntity<any>>

Parameters:#

NameType
typeConstructor<any>
valueany
modestring

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:69


invalidVersionFieldType#

StaticinvalidVersionFieldType(meta: EntityMetadata<any>): MetadataError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:170


missingMetadata#

StaticmissingMetadata(entity: string): MetadataError<AnyEntity<any>>

Parameters:#

NameType
entitystring

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:195


multipleDecorators#

StaticmultipleDecorators(entityName: string, propertyName: string): MetadataError<AnyEntity<any>>

Parameters:#

NameType
entityNamestring
propertyNamestring

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:191


multipleVersionFields#

StaticmultipleVersionFields(meta: EntityMetadata<any>, fields: string[]): MetadataError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>
fieldsstring[]

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:166


noEntityDiscovered#

StaticnoEntityDiscovered(): MetadataError<AnyEntity<any>>

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:179


notDiscoveredEntity#

StaticnotDiscoveredEntity(data: any, meta?: EntityMetadata<any>): ValidationError<AnyEntity<any>>

Parameters:#

NameType
dataany
meta?EntityMetadata<any>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:52


notEntity#

StaticnotEntity(owner: AnyEntity<any>, prop: EntityProperty<any>, data: any): ValidationError<AnyEntity<any>>

Parameters:#

NameType
ownerAnyEntity<any>
propEntityProperty<any>
dataany

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:47


onlyAbstractEntitiesDiscovered#

StaticonlyAbstractEntitiesDiscovered(): MetadataError<AnyEntity<any>>

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:183


transactionRequired#

StatictransactionRequired(): ValidationError<AnyEntity<any>>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:39


unknownIndexProperty#

StaticunknownIndexProperty(meta: EntityMetadata<any>, prop: string, type: string): MetadataError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>
propstring
typestring

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:162

Last updated on by Martin Adámek