new ExpressionDataMapping()
Maps raw data to data objects, using FRB expressions, of a specific type.
TODO: Write more thorough description.
Extends
- external:DataMapping
Members
addObjectMappingRule
Adds a rule to be used for mapping objects to raw data.
addRawDataMappingRule
Adds a rule to be used for mapping raw data to objects.
addRequisitePropertyName
Adds a name to the list of properties that will participate in
eager mapping. The requisite property names will be mapped
during the map from raw data phase.
initWithServiceObjectDescriptorAndSchema
mapFromRawData
- Source:
- To Do:
-
- Document deprecation in favor of mapRawDataToObject()
mapToRawData
- Source:
- To Do:
-
- Document deprecation in favor of mapObjectToRawData()
objectDescriptor :ObjectDescriptor
The descriptor of the objects that are mapped to by this
data mapping.
Type:
objectDescriptorReference :ObjectDescriptorReference
A reference to the object descriptor that is used
by this mapping. Used by serialized data mappings.
Type:
- ObjectDescriptorReference
requisitePropertyNames
schemaDescriptor :ObjectDescriptor
The descriptor of the "raw data" mapped from by this
data mapping.
Type:
schemaDescriptorReference :ObjectDescriptorReference
A reference to the object descriptor of the "raw data" that
is used by this mapping. Used by serialized data mappings.
Type:
- ObjectDescriptorReference
service :DataService
The service that owns this mapping object.
Used to create fetches for relationships.
Type:
Methods
mapObjectToCriteriaSourceForProperty(object, data, propertyName)
Convert model object properties to the raw data properties present in the requirements
for a given propertyName
Parameters:
Name | Type | Description |
---|---|---|
object |
Object | An object whose properties' values hold the model data. |
data |
Object | An object whose properties must be set or modified to represent the model data. |
propertyName |
string | The name of the property whose requirements need to be populated in the raw data. |
mapObjectToRawData(object, data)
Convert model objects to raw data objects of an appropriate type.
Subclasses should override this method to map properties of the model objects
to raw data, as in the following:
mapObjectToRawData: {
value: function (object, data) {
data.GIVEN_NAME = object.firstName;
data.FAMILY_NAME = object.lastName;
}
}
The default implementation of this method copies the properties defined
by the model object to the raw data object.
Parameters:
Name | Type | Description |
---|---|---|
object |
Object | An object whose properties' values hold the model data. |
data |
Object | An object whose properties must be set or modified to represent the model data |
mapObjectToRawDataProperty(object, data, propertyName)
Returns the value of a single raw data property evaluated against the model object
Parameters:
Name | Type | Description |
---|---|---|
object |
Object | An object whose properties' values hold the model data. |
data |
Object | The object on which to assign the property |
propertyName |
string | The name of the raw property to which to assign the values. |
mapRawDataToObject(data, object)
Convert raw data to data objects of an appropriate type.
Subclasses should override this method to map properties of the raw data
to data objects, as in the following:
mapRawDataToObject: {
value: function (data, object) {
object.firstName = data.GIVEN_NAME;
object.lastName = data.FAMILY_NAME;
}
}
The default implementation of this method copies the properties defined
by the raw data object to the data object.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | An object whose properties' values hold the raw data. |
object |
Object | An object whose properties must be set or modified to represent the raw data. |
mapRawDataToObjectProperty(data, object, propertyName)
Returns the value of a single model property evaluated against the raw data object
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | An object whose properties' values hold the raw data. |
object |
Object | The object on which to assign the property |
propertyName |
string | The name of the model property to which to assign the values. |
resolvePrerequisitesForProperty(object, propertyName)
Pre-fetches the model properties that are required to map another model property
Parameters:
Name | Type | Description |
---|---|---|
object |
Object | The object on which to prefetch properties |
propertyName |
string | The name of the model property for which there are prerequisites |
serviceIdentifierForProperty(propertyName)
Returns the identifier of the child service of .service that is used to
fetch propertyName
Parameters:
Name | Type | Description |
---|---|---|
propertyName |
string | The name of a model property |