From 8fe92b94ce5e1e2857d088752d94e19db7e3d8a8 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Sun, 17 Jun 2012 22:31:44 -0700 Subject: montage v11 merge into ninja Signed-off-by: Valerio Virgillito --- node_modules/montage/data/query.js | 123 +++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 67 deletions(-) (limited to 'node_modules/montage/data/query.js') diff --git a/node_modules/montage/data/query.js b/node_modules/montage/data/query.js index 9fce9dae..0f0d71fb 100755 --- a/node_modules/montage/data/query.js +++ b/node_modules/montage/data/query.js @@ -1,70 +1,69 @@ /* -This file contains proprietary software owned by Motorola Mobility, Inc.
-No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
-(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. -
*/ + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. + */ /** - @module montage/data/query - @requires montage/core/core - @requires montage/data/selector - @requires montage/core/logger -*/ + @module montage/data/query + @requires montage/core/core + @requires montage/core/logger + */ var Montage = require("montage").Montage; -var Selector = require("data/selector").Selector; -var Key = require("data/selector").Key; var logger = require("core/logger").logger("query"); /** - @class module:montage/data/query.Query - @extends module:montage/data/selector.Selector -*/ -var Query = exports.Query = Montage.create(Selector,/** @lends module:montage/data/query.Query# */ { -/** - Description TODO - @type {Property} - @default {Function} null - */ + @class module:montage/data/query.Query + */ +var Query = exports.Query = Montage.create(Montage, /** @lends module:montage/data/query.Query# */ { + /** + Description TODO + @type {Property} + @default {Function} null + */ blueprint: { value: null, serializable: true }, -/** - Description TODO - @type {Property} - @default {Selector} null - */ + + /** + Description TODO + @type {Property} + @default {Selector} null + */ selector: { value: null, serializable: true }, -/** - Description TODO - @type {Property} - @default {String} "" - */ + + /** + Description TODO + @type {Property} + @default {String} "" + */ name: { serializable: true, enumerable: true, value: "" }, -/** - Description TODO - @function - @param {Function} blueprint TODO - @returns this.initWithBlueprintAndSelector(blueprint, null) - */ + + /** + Description TODO + @function + @param {Function} blueprint TODO + @returns this.initWithBlueprintAndSelector(blueprint, null) + */ initWithBlueprint: { enumerable: true, value: function(blueprint) { return this.initWithBlueprintAndSelector(blueprint, null); } }, -/** - Description TODO - @function - @param {Function} blueprint TODO - @param {Selector} selector TODO - @returns itself - */ + /** + Description TODO + @function + @param {Function} blueprint TODO + @param {Selector} selector TODO + @returns itself + */ initWithBlueprintAndSelector: { enumerable: true, value: function(blueprint, selector) { @@ -78,36 +77,26 @@ var Query = exports.Query = Montage.create(Selector,/** @lends module:montage/da return this; } }, -/** - Description TODO - @function - @param {Function} propertyPath TODO - @returns this.selector - */ + /** + Description TODO + @function + @param {Function} propertyPath TODO + @returns this.selector + */ where: { value: function(propertyPath) { - // where clause with an empty key path is a noop. - if ((propertyPath != null) && (typeof propertyPath == 'string') && (propertyPath.length > 0)) { - // TODO [PJYF Aug 23 2011] We should check that the key path is valid - return Key.create().init(this, [propertyPath]); - } - return this.selector; + return this.selector.and.property(propertyPath) } }, -/** - Description TODO - @function - @param {Function} propertyPath TODO - @returns this.selector - */ + /** + Description TODO + @function + @param {Function} propertyPath TODO + @returns this.selector + */ property: { value: function(propertyPath) { - if (((propertyPath) != null) && (typeof (propertyPath) == 'string') && (propertyPath.length > 0)) { - // TODO [PJYF Aug 23 2011] We should check that the key path is valid - return Key.create().init(this, [(propertyPath)]); - } - // TODO [PJYF Aug 23 2011] We should raise here. - return this.selector; + return this.selector.and.property(propertyPath) } } -- cgit v1.2.3