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

Unified Diff: pkg/gcloud/lib/src/db/model_db.dart

Issue 804973002: Add appengine/gcloud/mustache dependencies. (Closed) Base URL: git@github.com:dart-lang/pub-dartlang-dart.git@master
Patch Set: Added AUTHORS/LICENSE/PATENTS files Created 6 years 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 | « pkg/gcloud/lib/src/db/db.dart ('k') | pkg/gcloud/lib/src/db/model_db_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/gcloud/lib/src/db/model_db.dart
diff --git a/pkg/gcloud/lib/src/db/model_db.dart b/pkg/gcloud/lib/src/db/model_db.dart
new file mode 100644
index 0000000000000000000000000000000000000000..0655ac3ad8c8faf3c0da4b18f02a7c6064e95d35
--- /dev/null
+++ b/pkg/gcloud/lib/src/db/model_db.dart
@@ -0,0 +1,43 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of gcloud.db;
+
+/**
+ * A database of all registered models.
+ *
+ * Responsible for converting between dart model objects and datastore entities.
+ */
+abstract class ModelDB {
+ /**
+ * Converts a [datastore.Key] to a [Key].
+ */
+ Key fromDatastoreKey(datastore.Key datastoreKey);
+
+ /**
+ * Converts a [Key] to a [datastore.Key].
+ */
+ datastore.Key toDatastoreKey(Key dbKey);
+
+ /**
+ * Converts a [Model] instance to a [datastore.Entity].
+ */
+ datastore.Entity toDatastoreEntity(Model model) ;
+
+ /**
+ * Converts a [datastore.Entity] to a [Model] instance.
+ */
+ Model fromDatastoreEntity(datastore.Entity entity);
+
+ /**
+ * Returns the kind name for instances of [type].
+ */
+ String kindName(Type type);
+
+ /**
+ * Returns the property name used for [fieldName]
+ */
+ // TODO: Get rid of this eventually.
+ String fieldNameToPropertyName(String kind, String fieldName);
+}
« no previous file with comments | « pkg/gcloud/lib/src/db/db.dart ('k') | pkg/gcloud/lib/src/db/model_db_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698