Class: EntityType

metamodel.EntityType(ref, superType, typeConstructoropt)

new EntityType(ref, superType, typeConstructoropt)

Parameters:
Name Type Attributes Description
ref string
superType metamodel.EntityType
typeConstructor Class.<binding.Entity> <optional>
Source:

Extends

Classes

Object

Members

acl :metamodel.SingularAttribute

Type:
Source:

declaredAcl :metamodel.SingularAttribute

Type:
Source:

declaredAttributes :Array.<metamodel.Attribute>

Type:
  • Array.<metamodel.Attribute>
Inherited From:
Source:

declaredId :metamodel.SingularAttribute

Type:
Source:

declaredVersion :metamodel.SingularAttribute

Type:
Source:

deletePermission :util.Permission

Type:
Source:

enhancer :binding.Enhancer

Type:
Inherited From:
Source:

id :metamodel.SingularAttribute

Type:
Source:

insertPermission :util.Permission

Type:
Source:

(readonly) isBasic :boolean

Type:
  • boolean
Inherited From:
Source:

(readonly) isEmbeddable :boolean

Type:
  • boolean
Inherited From:
Source:

(readonly) isEntity :boolean

Type:
  • boolean
Inherited From:
Source:

(readonly) isMappedSuperclass :boolean

Type:
  • boolean
Inherited From:
Source:

loadPermission :util.Permission

Type:
Source:

metadata :Object.<string, string>|null

Type:
  • Object.<string, string> | null
Inherited From:
Source:

name :string

Type:
  • string
Inherited From:
Source:

(readonly) persistenceType :number

The persistent type of this type

Type:
  • number
Overrides:
Source:

queryPermission :util.Permission

Type:
Source:

ref :string

Type:
  • string
Inherited From:
Source:

schemaAddPermission :util.Permission

Type:
Inherited From:
Source:

schemaReplacePermission :util.Permission

Type:
Inherited From:
Source:

schemaSubclassPermission :util.Permission

Type:
Source:

superType :metamodel.EntityType

Type:
Source:

typeConstructor :Class.<binding.Managed>

The Managed class

Type:
  • Class.<binding.Managed>
Overrides:
Source:

updatePermission :util.Permission

Type:
Source:

validationCode :function

Type:
  • function
Overrides:
Source:

version :metamodel.SingularAttribute

Type:
Source:

Methods

addAttribute(attr, orderopt) → {void}

Adds an attribute to this type

Parameters:
Name Type Attributes Description
attr metamodel.Attribute

The attribute to add

order number <optional>

Position of the attribute

Inherited From:
Source:
Returns:
Type
void

attributes() → {Iterator.<metamodel.Attribute>}

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

Inherited From:
Source:
Returns:
Type
Iterator.<metamodel.Attribute>

create() → {object}

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.

Inherited From:
Source:
Returns:

The created instance

Type
object

createObjectFactory(db) → {binding.ManagedFactory.<*>}

Creates an ObjectFactory for this type and the given EntityManager

Parameters:
Name Type Description
db EntityManager

The created instances will be attached to this EntityManager

Overrides:
Source:
Returns:

the crated object factory for the given EntityManager

Type
binding.ManagedFactory.<*>

createProxyClass() → {Class.<*>}

Creates an ProxyClass for this type

Overrides:
Source:
Returns:

the crated proxy class for this type

Type
Class.<*>

fromJsonValue(state, jsonObject, currentObject, optionsopt) → {*}

Parameters:
Name Type Attributes Description
state util.Metadata

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

jsonObject json

The json data to merge

currentObject *

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

options Object <optional>

The options used to apply the json

Properties
Name Type Attributes Default Description
persisting boolean <optional>
false

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

onlyMetadata boolean <optional>
false

Indicates if only the metadata should be updated

Overrides:
Source:
Returns:

The merged entity instance

Type
*

getAttribute(namenon-null) → {metamodel.Attribute}

Parameters:
Name Type Description
name string
Inherited From:
Source:
Returns:
Type
metamodel.Attribute

getDeclaredAttribute(val) → {metamodel.Attribute}

Parameters:
Name Type Description
val string | number

Name or order of the attribute

Inherited From:
Source:
Returns:
Type
metamodel.Attribute

getMetadata(key) → {null|string}

Gets some metadata of this type

Parameters:
Name Type Description
key string
Inherited From:
Source:
Returns:
Type
null | string

getReferencing(db, optionsopt) → {Map.<metamodel.ManagedType, Set.<string>>}

Gets all on this class referencing attributes

Parameters:
Name Type Attributes Description
db EntityManager

The instances will be found by this EntityManager

options Object <optional>

Some options to pass

Properties
Name Type Attributes Description
classes Array.<string> <optional>

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

Source:
Returns:

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

Type
Map.<metamodel.ManagedType, Set.<string>>

hasMetadata(key) → {boolean}

Retrieves whether this type has specific metadata

Parameters:
Name Type Description
key string
Inherited From:
Source:
Returns:
Type
boolean

init(enhancer) → {void}

Initialize this type

Parameters:
Name Type Description
enhancer binding.Enhancer

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

Inherited From:
Source:
Returns:
Type
void

references() → {Iterator.<EntityType>}

Returns iterator to get all referenced entities

Inherited From:
Source:
Returns:
Type
Iterator.<EntityType>

removeAttribute(name) → {void}

Removes an attribute from this type

Parameters:
Name Type Description
name string

The Name of the attribute which will be removed

Inherited From:
Source:
Returns:
Type
void

toJSON() → {json}

Converts ths type schema to json

Overrides:
Source:
Returns:
Type
json

toJsonValue(state, object, optionsopt) → {json}

Converts the given object to json

Parameters:
Name Type Attributes Default Description
state util.Metadata

The root object state

object *

The object to convert

options Object <optional>
false

to json options by default excludes the metadata

Properties
Name Type Attributes Default Description
excludeMetadata boolean <optional>
false

Excludes the metadata form the serialized json

depth number | boolean <optional>
0

Includes up to depth referenced objects into the serialized json

persisting boolean <optional>
false

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

Overrides:
Source:
Returns:

JSON-Object

Type
json