74 lines
2.0 KiB
Plaintext
74 lines
2.0 KiB
Plaintext
/** @class Projection
|
|
*
|
|
* A Projection describes the projection of a domain object in the application.
|
|
* A Projection specifies the complete set of fields and relationships to be
|
|
* instantiated when the operation with which it is used is executed.
|
|
*
|
|
* A *default* Projection is one where each field is specified.
|
|
*
|
|
*/
|
|
Projection = {
|
|
domainObject : "" , /** function */
|
|
error : "", /** error report for this projection */
|
|
fields : "" , /** field names */
|
|
relationships : null /** relationships, which consist of a name and projection */
|
|
};
|
|
|
|
|
|
/** Projection constructor
|
|
*
|
|
* @class Projection
|
|
* @constructor
|
|
* @param {function} [constructor]
|
|
*/
|
|
function Projection(constructor) {};
|
|
|
|
|
|
|
|
/***** Projection methods
|
|
-------------------- *****/
|
|
|
|
/* @method addFields
|
|
addFields(fields)
|
|
IMMEDIATE
|
|
|
|
Add fields by name to the projection
|
|
|
|
@param fields String or [String]
|
|
The fields parameter is the name of a field or an array of field names. It can be a string
|
|
or an array of strings. Multiple field names are accepted as parameters.
|
|
|
|
@return {Projection} @chainable
|
|
addFields() returns the current Projection object, so that method
|
|
invocations can be chained.
|
|
*/
|
|
function addFields(fields) {};
|
|
|
|
/* @method addField
|
|
ALIAS for addFields for ease of use
|
|
addField(fields)
|
|
IMMEDIATE
|
|
@see addFields
|
|
|
|
Add fields to the projection
|
|
|
|
*/
|
|
function addField(fields) {};
|
|
|
|
|
|
/* @method addRelationship
|
|
addRelationship(name, projection)
|
|
IMMEDIATE
|
|
|
|
Add a relationship to the projection.
|
|
|
|
@param name {String} name of the relationship field in the domain object
|
|
@param projection {Projection} the projection to be assigned to the relationship
|
|
@return Projection @chainable
|
|
*/
|
|
function addRelationship(name, projection) {};
|
|
|
|
|
|
/* This file is a JavaScript module */
|
|
exports.Projection = Projection;
|