Skip to main content
Version: Next

Class: MetadataError<T>

core.MetadataError

Type parameters#

NameType
TT: AnyEntity = AnyEntity

Hierarchy#

Constructors#

constructor#

new MetadataError<T>(message, entity?)

Type parameters#

NameType
TT: AnyEntity<any> = AnyEntity<any>

Parameters#

NameType
messagestring
entity?T

Inherited from#

ValidationError.constructor

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


stack#

Optional stack: string

Inherited from#

ValidationError.stack

Defined in#

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


prepareStackTrace#

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

Optional override for formatting stack traces

see https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Type declaration#

▸ (err, stackTraces): any

Parameters#
NameType
errError
stackTracesCallSite[]
Returns#

any

Inherited from#

ValidationError.prepareStackTrace

Defined in#

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


stackTraceLimit#

Static stackTraceLimit: number

Inherited from#

ValidationError.stackTraceLimit

Defined in#

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

Methods#

getEntity#

getEntity(): undefined | AnyEntity<any>

Gets instance of entity that caused this error.

Returns#

undefined | AnyEntity<any>

Inherited from#

ValidationError.getEntity

Defined in#

packages/core/src/errors.ts:17


cannotCommit#

Static cannotCommit(): ValidationError<AnyEntity<any>>

Returns#

ValidationError<AnyEntity<any>>

Inherited from#

ValidationError.cannotCommit

Defined in#

packages/core/src/errors.ts:96


cannotModifyInverseCollection#

Static cannotModifyInverseCollection(owner, property): ValidationError<AnyEntity<any>>

Parameters#

NameType
ownerAnyEntity<any>
propertyEntityProperty<any>

Returns#

ValidationError<AnyEntity<any>>

Inherited from#

ValidationError.cannotModifyInverseCollection

Defined in#

packages/core/src/errors.ts:79


cannotModifyReadonlyCollection#

Static cannotModifyReadonlyCollection(owner, property): ValidationError<AnyEntity<any>>

Parameters#

NameType
ownerAnyEntity<any>
propertyEntityProperty<any>

Returns#

ValidationError<AnyEntity<any>>

Inherited from#

ValidationError.cannotModifyReadonlyCollection

Defined in#

packages/core/src/errors.ts:88


cannotUseOperatorsInsideEmbeddables#

Static cannotUseOperatorsInsideEmbeddables(className, propName, payload): ValidationError<AnyEntity<any>>

Parameters#

NameType
classNamestring
propNamestring
payloadDictionary<any>

Returns#

ValidationError<AnyEntity<any>>

Inherited from#

ValidationError.cannotUseOperatorsInsideEmbeddables

Defined in#

packages/core/src/errors.ts:100


captureStackTrace#

Static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters#

NameType
targetObjectobject
constructorOpt?Function

Returns#

void

Inherited from#

ValidationError.captureStackTrace

Defined in#

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


conflictingPropertyName#

Static conflictingPropertyName(className, name, embeddedName): MetadataError<AnyEntity<any>>

Parameters#

NameType
classNamestring
namestring
embeddedNamestring

Returns#

MetadataError<AnyEntity<any>>

Defined in#

packages/core/src/errors.ts:207


duplicateEntityDiscovered#

Static duplicateEntityDiscovered(paths): MetadataError<AnyEntity<any>>

Parameters#

NameType
pathsstring[]

Returns#

MetadataError<AnyEntity<any>>

Defined in#

packages/core/src/errors.ts:195


entityNotFound#

Static entityNotFound(name, path): MetadataError<AnyEntity<any>>

Parameters#

NameType
namestring
pathstring

Returns#

MetadataError<AnyEntity<any>>

Defined in#

packages/core/src/errors.ts:166


entityNotManaged#

Static entityNotManaged(entity): ValidationError<AnyEntity<any>>

Parameters#

NameType
entityAnyEntity<any>

Returns#

ValidationError<AnyEntity<any>>

Inherited from#

ValidationError.entityNotManaged

Defined in#

packages/core/src/errors.ts:43


fromCollectionNotInitialized#

Static fromCollectionNotInitialized(entity, prop): ValidationError<AnyEntity<any>>

Parameters#

NameType
entityAnyEntity<any>
propEntityProperty<any>

Returns#

ValidationError<AnyEntity<any>>

Inherited from#

ValidationError.fromCollectionNotInitialized

Defined in#

packages/core/src/errors.ts:28


fromMergeWithoutPK#

Static fromMergeWithoutPK(meta): void

Parameters#

NameType
metaEntityMetadata<any>

Returns#

void

Inherited from#

ValidationError.fromMergeWithoutPK

Defined in#

packages/core/src/errors.ts:35


fromMissingPrimaryKey#

Static fromMissingPrimaryKey(meta): MetadataError<AnyEntity<any>>

Parameters#

NameType
metaEntityMetadata<any>

Returns#

MetadataError<AnyEntity<any>>

Defined in#

packages/core/src/errors.ts:134


fromUnknownEntity#

Static fromUnknownEntity(className, source): MetadataError<AnyEntity<any>>

Parameters#

NameType
classNamestring
sourcestring

Returns#

MetadataError<AnyEntity<any>>

Defined in#

packages/core/src/errors.ts:183


fromWrongOwnership#

Static fromWrongOwnership(meta, prop, key): MetadataError<AnyEntity<any>>

Parameters#

NameType
metaEntityMetadata<any>
propEntityProperty<any>
key"inversedBy" | "mappedBy"

Returns#

MetadataError<AnyEntity<any>>

Defined in#

packages/core/src/errors.ts:154


fromWrongPropertyType#

Static fromWrongPropertyType(entity, property, expectedType, givenType, givenValue): ValidationError<AnyEntity<any>>

Parameters#

NameType
entityAnyEntity<any>
propertystring
expectedTypestring
givenTypestring
givenValuestring

Returns#

ValidationError<AnyEntity<any>>

Inherited from#

ValidationError.fromWrongPropertyType

Defined in#

packages/core/src/errors.ts:21


fromWrongReference#

Static fromWrongReference(meta, prop, key, owner?): MetadataError<AnyEntity<any>>

Parameters#

NameType
metaEntityMetadata<any>
propEntityProperty<any>
key"inversedBy" | "mappedBy"
owner?EntityProperty<any>

Returns#

MetadataError<AnyEntity<any>>

Defined in#

packages/core/src/errors.ts:138


fromWrongReferenceType#

Static fromWrongReferenceType(meta, owner, prop): MetadataError<AnyEntity<any>>

Parameters#

NameType
metaEntityMetadata<any>
ownerEntityProperty<any>
propEntityProperty<any>

Returns#

MetadataError<AnyEntity<any>>

Defined in#

packages/core/src/errors.ts:161


fromWrongTypeDefinition#

Static fromWrongTypeDefinition(meta, prop): MetadataError<AnyEntity<any>>

Parameters#

NameType
metaEntityMetadata<any>
propEntityProperty<any>

Returns#

MetadataError<AnyEntity<any>>

Defined in#

packages/core/src/errors.ts:146


invalidCompositeIdentifier#

Static invalidCompositeIdentifier(meta): ValidationError<AnyEntity<any>>

Parameters#

NameType
metaEntityMetadata<any>

Returns#

ValidationError<AnyEntity<any>>

Inherited from#

ValidationError.invalidCompositeIdentifier

Defined in#

packages/core/src/errors.ts:92


invalidEmbeddableQuery#

Static invalidEmbeddableQuery(className, propName, embeddableType): ValidationError<AnyEntity<any>>

Parameters#

NameType
classNamestring
propNamestring
embeddableTypestring

Returns#

ValidationError<AnyEntity<any>>

Inherited from#

ValidationError.invalidEmbeddableQuery

Defined in#

packages/core/src/errors.ts:104


invalidPropertyName#

Static invalidPropertyName(entityName, invalid): ValidationError<AnyEntity<any>>

Parameters#

NameType
entityNamestring
invalidstring

Returns#

ValidationError<AnyEntity<any>>

Inherited from#

ValidationError.invalidPropertyName

Defined in#

packages/core/src/errors.ts:65


invalidType#

Static invalidType(type, value, mode): ValidationError<AnyEntity<any>>

Parameters#

NameType
typeConstructor<any>
valueany
modestring

Returns#

ValidationError<AnyEntity<any>>

Inherited from#

ValidationError.invalidType

Defined in#

packages/core/src/errors.ts:69


invalidVersionFieldType#

Static invalidVersionFieldType(meta): MetadataError<AnyEntity<any>>

Parameters#

NameType
metaEntityMetadata<any>

Returns#

MetadataError<AnyEntity<any>>

Defined in#

packages/core/src/errors.ts:178


missingMetadata#

Static missingMetadata(entity): MetadataError<AnyEntity<any>>

Parameters#

NameType
entitystring

Returns#

MetadataError<AnyEntity<any>>

Defined in#

packages/core/src/errors.ts:203


multipleDecorators#

Static multipleDecorators(entityName, propertyName): MetadataError<AnyEntity<any>>

Parameters#

NameType
entityNamestring
propertyNamestring

Returns#

MetadataError<AnyEntity<any>>

Defined in#

packages/core/src/errors.ts:199


multipleVersionFields#

Static multipleVersionFields(meta, fields): MetadataError<AnyEntity<any>>

Parameters#

NameType
metaEntityMetadata<any>
fieldsstring[]

Returns#

MetadataError<AnyEntity<any>>

Defined in#

packages/core/src/errors.ts:174


noEntityDiscovered#

Static noEntityDiscovered(): MetadataError<AnyEntity<any>>

Returns#

MetadataError<AnyEntity<any>>

Defined in#

packages/core/src/errors.ts:187


notDiscoveredEntity#

Static notDiscoveredEntity(data, meta?): ValidationError<AnyEntity<any>>

Parameters#

NameType
dataany
meta?EntityMetadata<any>

Returns#

ValidationError<AnyEntity<any>>

Inherited from#

ValidationError.notDiscoveredEntity

Defined in#

packages/core/src/errors.ts:52


notEntity#

Static notEntity(owner, prop, data): ValidationError<AnyEntity<any>>

Parameters#

NameType
ownerAnyEntity<any>
propEntityProperty<any>
dataany

Returns#

ValidationError<AnyEntity<any>>

Inherited from#

ValidationError.notEntity

Defined in#

packages/core/src/errors.ts:47


onlyAbstractEntitiesDiscovered#

Static onlyAbstractEntitiesDiscovered(): MetadataError<AnyEntity<any>>

Returns#

MetadataError<AnyEntity<any>>

Defined in#

packages/core/src/errors.ts:191


transactionRequired#

Static transactionRequired(): ValidationError<AnyEntity<any>>

Returns#

ValidationError<AnyEntity<any>>

Inherited from#

ValidationError.transactionRequired

Defined in#

packages/core/src/errors.ts:39


unknownIndexProperty#

Static unknownIndexProperty(meta, prop, type): MetadataError<AnyEntity<any>>

Parameters#

NameType
metaEntityMetadata<any>
propstring
typestring

Returns#

MetadataError<AnyEntity<any>>

Defined in#

packages/core/src/errors.ts:170