Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NavigationProperty

A NavigationProperty describes the metadata for a single property of an EntityType that return instances of other EntityTypes.

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

Hierarchy

  • NavigationProperty

Index

Constructors

constructor

  • NavigationProperty constructor

     let homeAddressProp = new NavigationProperty( {
         name: "homeAddress",
         entityTypeName: "Address:#myNamespace",
         isScalar: true,
         associationName: "address_person",
         foreignKeyNames: ["homeAddressId"]
     });
     let homeAddressIdProp = new DataProperty( {
         name: "homeAddressId"
         dataType: DataType.Integer
     });
     // assuming personEntityType is a newly constructed EntityType
     personEntityType.addProperty(homeAddressProp);
     personEntityType.addProperty(homeAddressIdProp);
    

    Parameters

    Returns NavigationProperty

Properties

associationName

associationName: string

The name of the association to which that this property belongs. This associationName will be shared with this properties 'inverse'. Read Only

Optional baseProperty

baseProperty: NavigationProperty

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

custom

custom: Object

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

displayName

displayName: string

The display name of this property. Read Only

entityType

entityType: EntityType

The EntityType returned by this property. Read Only

entityTypeName

entityTypeName: string

The name of the EntityType returned by this property. Read Only

foreignKeyNames

foreignKeyNames: string[]

The names of the foreign key DataProperties associated with this NavigationProperty. There will usually only be a single DataProperty associated with a Navigation property except in the case of entities with multipart keys. Read Only

foreignKeyNamesOnServer

foreignKeyNamesOnServer: string[]

The server side names of the foreign key DataProperties associated with this NavigationProperty. There will usually only be a single DataProperty associated with a Navigation property except in the case of entities with multipart keys. Read Only

formatName

formatName: formatName = DataProperty.prototype.formatName

getAllValidators

getAllValidators: getAllValidators = DataProperty.prototype.getAllValidators

invForeignKeyNames

invForeignKeyNames: string[]

invForeignKeyNamesOnServer

invForeignKeyNamesOnServer: string[]

isDataProperty

isDataProperty: boolean = false

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

isNavigationProperty

isNavigationProperty: boolean = true

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

isScalar

isScalar: boolean

Whether this property returns a single entity as opposed to an array of entities. Read Only

isUnmapped

isUnmapped: boolean

name

name: string

The name of this property. Read Only

nameOnServer

nameOnServer: string

The name of this property on the server. Read Only

parentEntityType

parentEntityType: EntityType

The EntityType that this property belongs to. ( same as entityType). Read Only

parentType

parentType: EntityType

The EntityType that this property belongs to. ( same as entityType). Read Only

relatedDataProperties

relatedDataProperties: DataProperty[]

The 'foreign key' DataProperties associated with this NavigationProperty. There will usually only be a single DataProperty associated with a Navigation property except in the case of entities with multipart keys. Read Only

resolveProperty

resolveProperty: resolveProperty = DataProperty.prototype.resolveProperty

validators

validators: Validator[]

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

Accessors

inverse

  • The inverse of this NavigationProperty. The NavigationProperty that represents a navigation in the opposite direction to this NavigationProperty. May be undefined for a undirectional NavigationProperty. Read Only

    Returns NavigationProperty | undefined

Methods

setInverse

setProperties

  • setProperties(config: { custom?: Object; displayName?: string; foreignKeyNames?: string[]; invForeignKeyNames?: string[]; inverse?: NavigationProperty | string }): void
  • General purpose property set method

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

    Parameters

    • config: { custom?: Object; displayName?: string; foreignKeyNames?: string[]; invForeignKeyNames?: string[]; inverse?: NavigationProperty | string }

      A config object

      • Optional custom?: Object
      • Optional displayName?: string
      • Optional foreignKeyNames?: string[]
      • Optional invForeignKeyNames?: string[]
      • Optional inverse?: NavigationProperty | string

    Returns void

toJSON

  • toJSON(): Object

Static fromJSON

Generated using TypeDoc