Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DataProperty

A DataProperty describes the metadata for a single property of an EntityType that contains simple data.

Instances of the DataProperty class are constructed automatically during Metadata retrieval. However it is also possible to construct them directly via the constructor.

Hierarchy

  • DataProperty

Index

Constructors

constructor

  • DataProperty constructor

     let lastNameProp = new DataProperty( {
         name: "lastName",
         dataType: DataType.String,
         isNullable: true,
         maxLength: 20
     });
     // assuming personEntityType is a newly constructed EntityType
     personEntityType.addProperty(lastNameProperty);

    Parameters

    Returns DataProperty

Properties

Optional baseProperty

baseProperty: DataProperty

Property on the base type that this property is inherited from. Will be null if the property is not on the base type. Read Only

Optional complexType

complexType: ComplexType

The ComplexType associated with this property; may be undefined. Read Only

complexTypeName

complexTypeName: string

The name of the ComplexType associated with this property; may be null. Read Only

concurrencyMode

concurrencyMode: string

Optional custom

custom: Object

A free form object that can be used to define any custom metadata for this DataProperty. Read Only

dataType

dataType: DataType | ComplexType

The DataType of this property. Read Only

defaultValue

defaultValue: any

The default value for this property. Read Only

displayName

displayName: string

The display name of this property. Read Only

Optional enumType

enumType: any

Optional inverseNavigationProperty

inverseNavigationProperty: NavigationProperty

isComplexProperty

isComplexProperty: boolean

Whether the contents of this property is an instance of a ComplexType. Read Only

isDataProperty

isDataProperty: boolean = true

Is this a DataProperty? - always true here. Allows polymorphic treatment of DataProperties and NavigationProperties. Read Only

isNavigationProperty

isNavigationProperty: boolean = false

Is this a NavigationProperty? - always false here. Allows polymorphic treatment of DataProperties and NavigationProperties. Read Only

isNullable

isNullable: boolean

Whether this property is nullable. Read Only

isPartOfKey

isPartOfKey: boolean

Whether this property is a 'key' property. Read Only

isScalar

isScalar: boolean

Whether this property is scalar (i.e., returns a single value as opposed to an array). Read Only

isSettable

isSettable: boolean

Whether this property is 'settable'. Read Only

isUnmapped

isUnmapped: boolean

Whether this property is an 'unmapped' property. Read Only

Optional maxLength

maxLength: number

The maximum length for the value of this property. Only meaningful for strings. Read Only

name

name: string

The name of this property. Read Only

nameOnServer

nameOnServer: string

The name of this property on the server. Read Only

parentType

parentType: StructuralType

The parent type that this property belongs to - will be either a EntityType or a ComplexType. Read Only

Optional rawTypeName

rawTypeName: string

The raw type name of this property. will only be defined for properties with a DataType of 'Undefined'

Optional relatedNavigationProperty

relatedNavigationProperty: NavigationProperty

The navigation property related to this property. Will only be set if this is a foreign key property. Read Only

validators

validators: Validator[]

The Validator instances that are associated with this property. Validators can be added and removed from this collection. Read Only

Methods

formatName

  • formatName(): string

getAllValidators

resolveProperty

  • resolveProperty(propName: string): any

setProperties

  • setProperties(config: object): void
  • General purpose property set method

     // assume em1 is an EntityManager
     let prop = myEntityType.getProperty("myProperty");
     prop.setProperties( {
         custom: { foo: 7, bar: "test" }
     });

    Parameters

    • config: object

      A configuration object.

    Returns void

toJSON

  • toJSON(): Object

Static fromJSON

Static getRawValueFromClient

  • getRawValueFromClient(rawEntity: Object, dp: DataProperty): any

Static getRawValueFromServer

  • getRawValueFromServer(rawEntity: Object, dp: DataProperty): any

Generated using TypeDoc