Class EntityType<T>

Type Parameters

Hierarchy

Constructors

Properties

_typeConstructor?: Class<T>
_validationCode: null | Function = null
declaredAcl: null | SingularAttribute<Acl> = null
declaredAttributes: Attribute<any>[] = []
declaredId: null | SingularAttribute<String> = null
declaredVersion: null | SingularAttribute<Number> = null
deletePermission: Permission = ...
enhancer: null | Enhancer = null
insertPermission: Permission = ...
loadPermission: Permission = ...
metadata: null | {
    [key: string]: string;
} = null
name: string
queryPermission: Permission = ...
ref: string
schemaAddPermission: Permission = ...
schemaReplacePermission: Permission = ...
schemaSubclassPermission: Permission = ...
superType: null | EntityType<any> = null
updatePermission: Permission = ...
Object: typeof ObjectType = ...

Accessors

  • get isBasic(): boolean
  • Returns boolean

  • get isEmbeddable(): boolean
  • Returns boolean

  • get isEntity(): boolean
  • Returns boolean

  • get isMappedSuperclass(): boolean
  • Returns boolean

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

    Returns PersistenceType

  • 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 ProxyClass for this type

    Returns

    the crated proxy class for this type

    Returns Class<T>

  • Returns

    The merged entity instance

    Parameters

    • state: ManagedState

      The root object state, can be null if a currentObject is provided

    • 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;
      }

      The options used to apply the json

      • Optional onlyMetadata?: boolean

        Indicates if only the metadata should be updated

      • Optional persisting?: boolean

        indicates if the current state will be persisted. Used to update the internal change tracking state of collections and mark the object persistent or dirty afterwards

    Returns null | T

  • 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

  • Gets all on this class referencing attributes

    Returns

    A map from every referencing class to a set of its referencing attribute names

    Parameters

    • db: EntityManager

      The instances will be found by this EntityManager

    • Optional options: {
          classes?: string[];
      }

      Some options to pass

      • Optional classes?: string[]

        An array of class names to filter for, null for no filter

    Returns Map<ManagedType<any>, Set<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 the given object to json

    Returns

    JSON-Object

    Parameters

    • state: ManagedState

      The root object state

    • object: null | T

      The object to convert

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

      to json options by default excludes the metadata

      • Optional depth?: number | boolean

        Includes up to depth referenced objects into the serialized json

      • Optional excludeMetadata?: boolean

        Excludes the metadata form the serialized json

      • Optional persisting?: boolean

        indicates if the current state will be persisted. Used to update the internal change tracking state of collections and mark the object persistent if its true

    Returns Json

  • Returns string

Generated using TypeDoc