ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [2/3] ignite git commit: IGNITE-2458 Fixed code gen.
Date Fri, 29 Jan 2016 09:51:46 GMT
IGNITE-2458 Fixed code gen.


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

Branch: refs/heads/ignite-843-rc2
Commit: 455d92d5ba054c94b29535cf6d7f66fd42e2a527
Parents: 250a242
Author: vsisko <vsisko@gridgain.com>
Authored: Fri Jan 29 16:50:51 2016 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Fri Jan 29 16:50:51 2016 +0700

----------------------------------------------------------------------
 .../main/js/helpers/generator/generator-java.js | 41 +++++++++++++++++++-
 .../main/js/helpers/generator/generator-xml.js  | 30 +++++++++++++-
 2 files changed, 67 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/455d92d5/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-java.js b/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
index e1de3c8..9dfef12 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
@@ -1497,8 +1497,45 @@ $generatorJava.domainModelGeneral = function (domain, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    $generatorJava.classNameProperty(res, 'typeMeta', domain, 'keyType');
-    $generatorJava.property(res, 'typeMeta', domain, 'valueType');
+    switch ($generatorCommon.domainQueryMetadata(domain)) {
+        case 'Annotations':
+            if ($commonUtils.isDefinedAndNotEmpty(domain.keyType) || $commonUtils.isDefinedAndNotEmpty(domain.valueType))
{
+                var types = [];
+
+                if ($commonUtils.isDefinedAndNotEmpty(domain.keyType))
+                    types.push($generatorJava.toJavaCode(res.importClass(domain.keyType),
'class'));
+                else
+                    types.push('???');
+
+                if ($commonUtils.isDefinedAndNotEmpty(domain.valueType))
+                    types.push($generatorJava.toJavaCode(res.importClass(domain.valueType),
'class'));
+                else
+                    types.push('???');
+
+                if ($commonUtils.isDefinedAndNotEmpty(types)) {
+                    res.startBlock('cache.setIndexedTypes(');
+
+                    res.line(types.join(', '));
+
+                    res.endBlock(');');
+                }
+            }
+
+            break;
+
+        case 'Configuration':
+            $generatorJava.classNameProperty(res, 'jdbcTypes', domain, 'keyType');
+            $generatorJava.property(res, 'jdbcTypes', domain, 'valueType');
+
+            if ($commonUtils.isDefinedAndNotEmpty(domain.fields)) {
+                res.needEmptyLine = true;
+
+                $generatorJava.classNameProperty(res, 'qryMeta', domain, 'keyType');
+                $generatorJava.property(res, 'qryMeta', domain, 'valueType');
+            }
+
+            break;
+    }
 
     res.needEmptyLine = true;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/455d92d5/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js b/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
index 19074fa..2b17099 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
@@ -1125,8 +1125,34 @@ $generatorXml.domainModelGeneral = function(domain, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    $generatorXml.classNameProperty(res, domain, 'keyType');
-    $generatorXml.property(res, domain, 'valueType');
+    switch ($generatorCommon.domainQueryMetadata(domain)) {
+        case 'Annotations':
+            if ($commonUtils.isDefinedAndNotEmpty(domain.keyType) || $commonUtils.isDefinedAndNotEmpty(domain.valueType))
{
+                res.startBlock('<property name="indexedTypes">');
+                res.startBlock('<list>');
+
+                if ($commonUtils.isDefinedAndNotEmpty(domain.keyType))
+                    res.line('<value>' + $dataStructures.fullClassName(domain.keyType)
+ '</value>');
+                else
+                    res.line('<value>???</value>');
+
+                if ($commonUtils.isDefinedAndNotEmpty(domain.valueType))
+                    res.line('<value>' + $dataStructures.fullClassName(domain.valueType)
+ '</value>');
+                else
+                    res.line('<value>>???</value>');
+
+                res.endBlock('</list>');
+                res.endBlock('</property>');
+            }
+
+            break;
+
+        case 'Configuration':
+            $generatorXml.classNameProperty(res, domain, 'keyType');
+            $generatorXml.property(res, domain, 'valueType');
+
+            break;
+    }
 
     res.needEmptyLine = true;
 


Mime
View raw message