Show:

Class for loading metadata about models.

Methods

createEnum

(
  • dictionary
)
Object

Returns friezed object without prototype with own properties of parameter.

Parameters:

Returns:

enumCaptions

(
  • dictionary
)
Object

Returns object without null values.

Parameters:

Returns:

firstLoadOfflineObjects

(
  • dexieDB
  • odataPath
  • functionName
  • modelName
  • count
  • top
  • skip
  • idPath
)
Promise

Load and save offline objects provided by odata function or returns objects count. Tables with objects to load must be empty.

Parameters:

  • dexieDB Object

    Dexie DB (example: dexieService.dexie('DB name', store)).

  • odataPath String

    Odata Url (example: 'http://localhost:35904/odata').

  • functionName String

    Odata function name.

  • modelName String

    Model name for objects.

  • count Bool

    Flag indicates that function returns objects or objects count.

  • top Integer

    Amount of objects to load.

  • skip Integer

    Amount of objects to skip from result.

  • idPath String

    Path to string id in JSON ('guid' by default).

Returns:

getType

(
  • modelName
  • attributePath
)
String public

Returns the type of the specified attribute path.

Parameters:

  • modelName String

    The name of the model.

  • attributePath String

    The path to the attribute.

Returns:

String:

The type of the specified attribute path.

inverseEnum

(
  • dictionary
)
Object

Returns friezed inversed object without prototype.

Parameters:

Returns:

isAttribute

(
  • modelName
  • attributePath
)
Boolean public

Checks if the specified attribute path is an attribute.

Parameters:

  • modelName String

    The name of the model.

  • attributePath String

    The path to the attribute.

Returns:

Boolean:

True if the specified attribute path is an attribute.

isDetail

(
  • modelName
  • attributePath
)
Boolean public

Checks if the specified attribute path is a detail field.

Parameters:

  • modelName String

    The name of the model.

  • attributePath String

    The path to the attribute.

Returns:

Boolean:

True if the specified attribute path is a detail field.

isExist

(
  • modelName
  • attributePath
)
Boolean public

Checks if the specified attribute path is exist.

Parameters:

  • modelName String

    The name of the model.

  • attributePath String

    The path to the attribute.

Returns:

Boolean:

True if the specified attribute path is exist.

isKey

(
  • modelName
  • attributePath
)
Boolean public

Checks if the specified attribute path is a key (i.e. it is an id or belongsTo relationship).

Parameters:

  • modelName String

    The name of the model.

  • attributePath String

    The path to the attribute.

Returns:

Boolean:

True if the specified attribute path is a key.

isMaster

(
  • modelName
  • attributePath
)
Boolean public

Checks if the specified attribute path is a master field.

Parameters:

  • modelName String

    The name of the model.

  • attributePath String

    The path to the attribute.

Returns:

Boolean:

True if the specified attribute path is a master field.

isOrdered

(
  • modelName
  • attributePath
)
Boolean public

Checks if the specified attribute path is a ordered field.

Parameters:

  • modelName String

    The name of the model.

  • attributePath String

    The path to the attribute.

Returns:

Boolean:

True if the specified attribute path is a detail field.

isRelationship

(
  • modelName
  • attributePath
)
Boolean public

Checks if the specified attribute path is a relationship.

Parameters:

  • modelName String

    The name of the model.

  • attributePath String

    The path to the attribute.

Returns:

Boolean:

True if the specified attribute path is a relationship.

parseAttributePath

(
  • attributePath
)
Array public static

Parses the specified attribute paths and returns list of separate attributes.

Parameters:

  • attributePath String

    The path to the attribute.

Returns:

Array:

List of separate attributes.