Class Metamodel

This base class provides an lock interface to execute exclusive operations

Hierarchy

Constructors

Properties

baseTypes: {
    [name: string]: BasicType<any>;
} = {}

Type declaration

embeddables: {
    [name: string]: EmbeddableType<any>;
} = {}

Type declaration

enhancer: Enhancer = ...
entities: {
    [name: string]: EntityType<any>;
} = {}

Type declaration

entityManagerFactory: EntityManagerFactory
isInitialized: boolean = false

Defines if the Metamodel has been finalized

Accessors

  • get isReady(): boolean
  • Indicates if there is currently no exclusive operation executed true If no exclusive lock is hold

    Returns boolean

Methods

  • Returns

    the added type

    Parameters

    Returns Type<any>

  • Return the metamodel basic type representing the native class.

    Returns

    the metamodel basic type

    Parameters

    • typeConstructor: string | Class<any>

      the type of the represented native class

    Returns null | BasicType<any>

  • Creates an index

    Returns

    Parameters

    • bucket: string

      Name of the Bucket

    • index: DbIndex

      Will be applied for the given bucket

    Returns Promise<any>

  • Drops all indexes

    Returns

    Parameters

    • bucket: string

      Indexes will be dropped for the given bucket

    Returns Promise<any>

  • Drops an index

    Returns

    Parameters

    • bucket: string

      Name of the Bucket

    • index: DbIndex

      Will be dropped for the given bucket

    Returns Promise<any>

  • Return the metamodel embeddable type representing the embeddable class.

    Returns

    the metamodel embeddable type or null if the class is not a managed embeddable

    Parameters

    • typeConstructor: string | Function | Class<any>

      the type of the represented embeddable class

    Returns null | EmbeddableType<any>

  • Return the metamodel entity type representing the entity.

    Returns

    the metamodel entity type or null if the class is not a managed entity

    Parameters

    • typeConstructor: string | Function | Class<any>

      the type of the represented entity

    Returns null | EntityType<any>

  • Replace the current schema by the provided one in json

    Returns

    Parameters

    • json: Json

      The json schema data

    Returns void

  • Loads all indexes for the given bucket

    Returns

    Parameters

    • bucket: string

      Current indexes will be loaded for the given bucket

    Returns Promise<DbIndex[]>

  • Returns

    Parameters

    Returns null | string

  • Prepare the Metamodel for custom schema creation

    Returns

    Parameters

    • Optional jsonMetamodel: JsonMap

      initialize the metamodel with the serialized json schema

    Returns void

  • Load all schema data from the server

    Returns

    Returns Promise<Metamodel>

  • Return the metamodel managed type representing the entity, mapped superclass, or embeddable class.

    Returns

    the metamodel managed type

    Parameters

    • typeConstructor: string | Function | Class<any>

      the type of the represented managed class

    Returns null | ManagedType<any>

  • Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled

    Returns

    A promise which completes successfully, when the previously requested operation completes

    Parameters

    • Optional doneCallback: ((this: Metamodel) => any)

      The callback which will be invoked when the previously operations on this object is completed.

    • Optional failCallback: ((error: Error) => any)

      When the lock can't be released caused by a none recoverable error

        • (error: Error): any
        • Parameters

          • error: Error

          Returns any

    Returns Promise<Metamodel>

  • Store all local schema data on the server, or the provided one

    Note: The schema must be initialized, by init or load

    Returns

    Parameters

    • Optional managedType: ManagedType<any>

      The specific type to persist, if omitted the complete schema will be updated

    Returns Promise<Metamodel>

  • Get the current schema types as json

    Returns

    the json data

    Returns JsonArray

  • Update the metamodel with the schema

    The provided data object will be forwarded to the UpdateAllSchemas resource. The underlying schema of this Metamodel object will be replaced by the result.

    Returns

    Parameters

    • data: JsonArray | JsonMap

      The JSON which will be send to the UpdateAllSchemas resource.

    Returns Promise<Metamodel>

  • Protected

    Try to aquire an exclusive lock and executes the given callback.

    Returns

    A promise

    Throws

    If the lock can't be aquired

    Type Parameters

    • T

    Parameters

    • callback: (() => Promise<T>)

      The exclusive operation to execute

        • (): Promise<T>
        • Returns Promise<T>

    • Optional critical: boolean = false

      Indicates if the operation is critical. If the operation is critical and the operation fails, then the lock will not be released

    Returns Promise<T>

Generated using TypeDoc