Class ManagedType<T>Abstract

Type Parameters

Hierarchy

Constructors

  • Type Parameters

    Parameters

    • ref: string

      or full class name

    • Optional typeConstructor: Class<T>

      The type constructor of the managed lass

    Returns ManagedType<T>

Properties

_typeConstructor?: Class<T>
_validationCode: null | Function = null
declaredAttributes: Attribute<any>[] = []
enhancer: null | Enhancer = null
metadata: null | {
    [key: string]: string;
} = null
name: string
ref: string
schemaAddPermission: Permission = ...
schemaReplacePermission: Permission = ...
superType: null | EntityType<any> = null

Accessors

  • get isBasic(): boolean
  • Returns boolean

  • get isEmbeddable(): boolean
  • Returns boolean

  • get isEntity(): boolean
  • Returns boolean

  • get isMappedSuperclass(): boolean
  • Returns boolean

  • get persistenceType(): number
  • The persistent type of this type

    Returns number

  • get typeConstructor(): Class<T>
  • The Managed class

    Returns Class<T>

  • set typeConstructor(typeConstructor: Class<T>): void
  • The Managed class constructor

    Parameters

    • typeConstructor: Class<T>

      The managed class constructor

    Returns void

  • get validationCode(): null | Function
  • Returns null | Function

  • set validationCode(code: null | Function): void
  • Parameters

    • code: null | Function

    Returns void

Methods

  • Adds an attribute to this type

    Returns

    Parameters

    • attr: Attribute<any>

      The attribute to add

    • Optional order: number

      Position of the attribute

    Returns void

  • An iterator which returns all attributes declared by this type and inherited form all super types

    Returns

    Returns IterableIterator<Attribute<any>>

  • Creates a new instance of the managed type, without invoking any constructors

    This method is used to create object instances which are loaded form the backend.

    Returns

    The created instance

    Returns T

  • Creates an ObjectFactory for this type and the given EntityManager

    Returns

    the crated object factory for the given EntityManager

    Parameters

    • db: EntityManager

      The created instances will be attached to this EntityManager

    Returns ManagedFactory<T>

  • Creates an ProxyClass for this type

    Returns

    the crated proxy class for this type

    Returns Class<T>

  • Merge the json data into the current object instance and returns the merged object

    Returns

    The merged object instance

    Parameters

    • state: ManagedState

      The root object state

    • jsonObject: Json

      The json data to merge

    • currentObject: null | T

      The object where the jsonObject will be merged into, if the current object is null, a new instance will be created

    • options: {
          onlyMetadata?: boolean;
          persisting: boolean;
      }

      additional options which are applied through the conversion

      • Optional onlyMetadata?: boolean
      • persisting: boolean

    Returns null | T

  • Returns

    Parameters

    • name: string

    Returns null | Attribute<any>

  • Returns

    Parameters

    • val: string | number

      Name or order of the attribute

    Returns null | Attribute<any>

  • Gets some metadata of this type

    Returns

    Parameters

    • key: string

    Returns null | string

  • Retrieves whether this type has specific metadata

    Returns

    Parameters

    • key: string

    Returns boolean

  • Initialize this type

    Parameters

    • enhancer: Enhancer

      The class enhancer used to instantiate an instance of this managed class

    Returns void

  • Returns iterator to get all referenced entities

    Returns

    Returns IterableIterator<{
        path: string[];
    }>

  • Removes an attribute from this type

    Returns

    Parameters

    • name: string

      The Name of the attribute which will be removed

    Returns void

  • Converts ths type schema to json

    Returns

    Returns JsonMap

  • Converts the given object to json

    Returns

    The converted object as json

    Parameters

    • state: ManagedState

      The root object state

    • object: null | T

      The object to convert

    • options: {
          depth?: number | boolean;
          excludeMetadata?: boolean;
          persisting: boolean;
      }

      additional options which are applied through the conversion

      • Optional depth?: number | boolean
      • Optional excludeMetadata?: boolean
      • persisting: boolean

    Returns Json

Generated using TypeDoc