ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [18/50] ignite git commit: IGNITE-2287 Do not import primitive keys as query fields and indexes.
Date Fri, 04 Mar 2016 09:31:13 GMT
IGNITE-2287 Do not import primitive keys as query fields and indexes.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f01fc590
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f01fc590
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f01fc590

Branch: refs/heads/ignite-843
Commit: f01fc590e576d1e58ff467f2d874e122585104b8
Parents: 6212669
Author: vsisko <vsisko@gridgain.com>
Authored: Sat Feb 20 17:07:33 2016 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Sat Feb 20 17:07:33 2016 +0700

----------------------------------------------------------------------
 .../main/js/controllers/domains-controller.js   | 22 ++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f01fc590/modules/control-center-web/src/main/js/controllers/domains-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/domains-controller.js b/modules/control-center-web/src/main/js/controllers/domains-controller.js
index d3b29ea..a7af8dd 100644
--- a/modules/control-center-web/src/main/js/controllers/domains-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/domains-controller.js
@@ -899,8 +899,26 @@ consoleModule.controller('domainsController', function ($filter, $http,
$timeout
                         newDomain.valueFields = keyFields.slice();
 
                     // Use Java built-in type for key.
-                    if ($scope.ui.builtinKeys && newDomain.keyFields.length === 1)
-                        newDomain.keyType = newDomain.keyFields[0].jdbcType.javaType;
+                    if ($scope.ui.builtinKeys && newDomain.keyFields.length === 1)
{
+                        var keyField = newDomain.keyFields[0];
+
+                        newDomain.keyType = keyField.jdbcType.javaType;
+
+                        // Exclude key column from query fields and indexes.
+                        newDomain.fields = _.filter(newDomain.fields, function (field) {
+                            return field.name != keyField.javaFieldName;
+                        });
+
+                        _.forEach(newDomain.indexes, function (index) {
+                            index.fields = _.filter(index.fields, function (field) {
+                                return field.name !== keyField.javaFieldName;
+                            })
+                        });
+
+                        newDomain.indexes = _.filter(newDomain.indexes, function (index)
{
+                            return !$common.isEmptyArray(index.fields);
+                        });
+                    }
 
                     // Prepare caches for generation.
                     if (table.action === IMPORT_DM_NEW_CACHE) {


Mime
View raw message