Skip to main content
Version: 4.5

Class: OptimisticLockError<T>#

core.OptimisticLockError

Type parameters#

NameTypeDefault
TAnyEntityAnyEntity

Hierarchy#

Constructors#

constructor#

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

Type parameters:#

NameTypeDefault
TAnyEntity<any>AnyEntity<any>

Parameters:#

NameType
messagestring
entity?T

Returns: OptimisticLockError<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: (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: Error, stackTraces: CallSite[]): any

Parameters:#

NameType
errError
stackTracesCallSite[]

Returns: any

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

Inherited from: ValidationError.prepareStackTrace

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


stack#

Optional stack: 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:96


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


cannotModifyReadonlyCollection#

StaticcannotModifyReadonlyCollection(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:88


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


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


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


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


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


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


lockFailed#

StaticlockFailed(entityOrName: string | AnyEntity<any>): OptimisticLockError<AnyEntity<any>>

Parameters:#

NameType
entityOrNamestring | AnyEntity<any>

Returns: OptimisticLockError<AnyEntity<any>>

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


lockFailedVersionMismatch#

StaticlockFailedVersionMismatch(entity: AnyEntity<any>, expectedLockVersion: number | Date, actualLockVersion: number | Date): OptimisticLockError<AnyEntity<any>>

Parameters:#

NameType
entityAnyEntity<any>
expectedLockVersionnumber | Date
actualLockVersionnumber | Date

Returns: OptimisticLockError<AnyEntity<any>>

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


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


notVersioned#

StaticnotVersioned(meta: EntityMetadata<any>): OptimisticLockError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>

Returns: OptimisticLockError<AnyEntity<any>>

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


transactionRequired#

StatictransactionRequired(): ValidationError<AnyEntity<any>>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

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

Last updated on by Martin Adámek