Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(513)

Unified Diff: lib/src/db/model_db_impl.dart

Issue 2731933004: Remove FilterRelation.In / "property IN" queries, upgrade googleapis{,_beta} dependencies (Closed)
Patch Set: add pubspec.yaml update Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/db/model_db.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/db/model_db_impl.dart
diff --git a/lib/src/db/model_db_impl.dart b/lib/src/db/model_db_impl.dart
index dc26f134eeb2601e6f39ccdb8340fc3d490079ca..b08a5d51bd7571569eef380469545662203f8378 100644
--- a/lib/src/db/model_db_impl.dart
+++ b/lib/src/db/model_db_impl.dart
@@ -155,12 +155,14 @@ class ModelDBImpl implements ModelDB {
}
/// Converts [value] according to the [Property] named [name] in [type].
- Object toDatastoreValue(String kind, String fieldName, Object value) {
+ Object toDatastoreValue(String kind, String fieldName, Object value,
+ {bool forComparison: false}) {
var modelDescription = _kind2ModelDesc[kind];
if (modelDescription == null) {
throw new ArgumentError('The kind "$kind" is unknown.');
}
- return modelDescription.encodeField(this, fieldName, value);
+ return modelDescription.encodeField(
+ this, fieldName, value, forComparison: forComparison);
}
Iterable<_ModelDescription> get _modelDescriptions {
@@ -457,10 +459,11 @@ class _ModelDescription {
}
Object encodeField(ModelDBImpl db, String fieldName, Object value,
- {bool enforceFieldExists: true}) {
+ {bool enforceFieldExists: true,
+ bool forComparison: false}) {
Property property = db._propertiesForModel(this)[fieldName];
if (property != null) {
- return property.encodeValue(db, value);
+ return property.encodeValue(db, value, forComparison: forComparison);
}
if (enforceFieldExists) {
throw new ArgumentError(
@@ -536,11 +539,12 @@ class _ExpandoModelDescription extends _ModelDescription {
}
Object encodeField(ModelDBImpl db, String fieldName, Object value,
- {bool enforceFieldExists: true}) {
+ {bool enforceFieldExists: true,
+ bool forComparison: false}) {
// The [enforceFieldExists] argument is intentionally ignored.
Object primitiveValue = super.encodeField(db, fieldName, value,
- enforceFieldExists: false);
+ enforceFieldExists: false, forComparison: forComparison);
// If superclass can't encode field, we return value here (and assume
// it's primitive)
// NOTE: Implicit assumption:
« no previous file with comments | « lib/src/db/model_db.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698