Class: Attribute

metamodel.Attribute(name, isMetadataopt)

new Attribute(name, isMetadataopt)

Parameters:
Name Type Attributes Description
name string

The attribute name

isMetadata boolean <optional>

true if the attribute is an metadata attribute

Source:

Members

(static) PersistentAttributeType :number

Type:
  • number
Properties:
Name Type Description
BASIC number
ELEMENT_COLLECTION number
EMBEDDED number
MANY_TO_MANY number
MANY_TO_ONE number
ONE_TO_MANY number
ONE_TO_ONE number
Source:

accessor :binding.Accessor

Type:
Source:

declaringType :metamodel.ManagedType

Type:
Source:

isAcl :boolean

Type:
  • boolean
Source:

(readonly) isAssociation :boolean

Type:
  • boolean
Source:

(readonly) isCollection :boolean

Type:
  • boolean
Source:

isId :boolean

Type:
  • boolean
Source:

isMetadata :boolean

Type:
  • boolean
Source:

isVersion :boolean

Type:
  • boolean
Source:

metadata :Object.<string, string>|null

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

name :string

Type:
  • string
Source:

order :number

Type:
  • number
Source:

(readonly) persistentAttributeType :Attribute.PersistentAttributeType

Returns the persistent attribute type

Type:
  • Attribute.PersistentAttributeType
Source:

Methods

(abstract) getJsonValue(state, object, options) → {*}

Gets this attribute value form the object as json

Parameters:
Name Type Description
state util.Metadata

The root object state

object *

The object which contains the value of this attribute

options Object

additional options which are applied through the conversion

Source:
Returns:

The converted json value

Type
*

getMetadata(key) → {null|string}

Gets some metadata of this type

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

getValue(entity) → {*}

Parameters:
Name Type Description
entity Object
Source:
Returns:
Type
*

hasMetadata(key) → {boolean}

Retrieves whether this type has specific metadata

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

init(declaringType, order) → {void}

Parameters:
Name Type Description
declaringType metamodel.ManagedType

The type that owns this attribute

order number

Position of the attribute

Source:
Returns:
Type
void

(abstract) setJsonValue(state, object, jsonValue, options) → {void}

Sets this attribute value from json to the object

Parameters:
Name Type Description
state util.Metadata

The root state

object *

The object which contains the attribute

jsonValue *

The json value to convert an set

options Object

additional options which are applied through the conversion

Source:
Returns:
Type
void

setValue(entity, value) → {void}

Parameters:
Name Type Description
entity Object
value *
Source:
Returns:
Type
void

toJSON() → {json}

Converts this attribute field to json

Source:
Returns:

The attribute description as json

Type
json