Version: 4.3

Class: ValidationError<T>

Type parameters

NameTypeDefault
TAnyEntityAnyEntity

Hierarchy

Constructors

constructor

+ new ValidationError(message: string, entity?: T): ValidationError

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

Parameters:

NameType
messagestring
entity?T

Returns: ValidationError

Properties

entity

Private Optional Readonly entity: T

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


message

message: string

Inherited from DriverException.message

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


name

name: string

Inherited from DriverException.name

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


stack

Optional stack: string

Inherited from DriverException.stack

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


Error

Static Error: ErrorConstructor

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

Methods

getEntity

getEntity(): AnyEntity | undefined

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

Gets instance of entity that caused this error.

Returns: AnyEntity | undefined


cannotCommit

StaticcannotCommit(): ValidationError

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

Returns: ValidationError


cannotModifyInverseCollection

StaticcannotModifyInverseCollection(owner: AnyEntity, property: EntityProperty): ValidationError

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

Parameters:

NameType
ownerAnyEntity
propertyEntityProperty

Returns: ValidationError


cannotUseOperatorsInsideEmbeddables

StaticcannotUseOperatorsInsideEmbeddables(className: string, propName: string, payload: Dictionary): ValidationError

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

Parameters:

NameType
classNamestring
propNamestring
payloadDictionary

Returns: ValidationError


entityNotManaged

StaticentityNotManaged(entity: AnyEntity): ValidationError

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

Parameters:

NameType
entityAnyEntity

Returns: ValidationError


fromCollectionNotInitialized

StaticfromCollectionNotInitialized(entity: AnyEntity, prop: EntityProperty): ValidationError

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

Parameters:

NameType
entityAnyEntity
propEntityProperty

Returns: ValidationError


fromMergeWithoutPK

StaticfromMergeWithoutPK(meta: EntityMetadata): void

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

Parameters:

NameType
metaEntityMetadata

Returns: void


fromWrongPropertyType

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

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

Parameters:

NameType
entityAnyEntity
propertystring
expectedTypestring
givenTypestring
givenValuestring

Returns: ValidationError


invalidCompositeIdentifier

StaticinvalidCompositeIdentifier(meta: EntityMetadata): ValidationError

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

Parameters:

NameType
metaEntityMetadata

Returns: ValidationError


invalidPropertyName

StaticinvalidPropertyName(entityName: string, invalid: string): ValidationError

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

Parameters:

NameType
entityNamestring
invalidstring

Returns: ValidationError


invalidType

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

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

Parameters:

NameType
typeConstructor<any>
valueany
modestring

Returns: ValidationError


notDiscoveredEntity

StaticnotDiscoveredEntity(data: any, meta?: EntityMetadata): ValidationError

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

Parameters:

NameType
dataany
meta?EntityMetadata

Returns: ValidationError


notEntity

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

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

Parameters:

NameType
ownerAnyEntity
propEntityProperty
dataany

Returns: ValidationError


transactionRequired

StatictransactionRequired(): ValidationError

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

Returns: ValidationError

Last updated on by Martin Adámek