ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [1/2] ignite git commit: IGNITE-1649 Java and XML generation fixes.
Date Thu, 15 Oct 2015 07:46:50 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc1 b226d1bf6 -> e254cdfbf


IGNITE-1649 Java and XML generation fixes.


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

Branch: refs/heads/ignite-843-rc1
Commit: 7084a90cf3704e079a556f2f0e7dcbbf2fb67861
Parents: b226d1b
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Thu Oct 15 14:41:05 2015 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Thu Oct 15 14:41:05 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/routes/generator/generator-java.js        |  8 +++++---
 .../src/main/js/routes/generator/generator-xml.js         | 10 +++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7084a90c/modules/control-center-web/src/main/js/routes/generator/generator-java.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-java.js b/modules/control-center-web/src/main/js/routes/generator/generator-java.js
index 2429f71..6bb5b63 100644
--- a/modules/control-center-web/src/main/js/routes/generator/generator-java.js
+++ b/modules/control-center-web/src/main/js/routes/generator/generator-java.js
@@ -201,7 +201,6 @@ $generatorJava.listProperty = function (res, varName, obj, propName, dataType,
s
  * @param varName Variable name.
  * @param obj Source object with data.
  * @param propName Property name to take from source object.
- * @param dataType Optional data type.
  * @param setterName Optional setter name.
  */
 $generatorJava.arrayProperty = function (res, varName, obj, propName, setterName) {
@@ -328,7 +327,7 @@ $generatorJava.beanProperty = function (res, varName, bean, beanPropName,
beanVa
                             break;
 
                         case 'bean':
-                            if (bean[propName])
+                            if ($commonUtils.isDefinedAndNotEmpty(bean[propName]))
                                 res.line(beanVarName + '.' + $generatorJava.setterName(propName)
+ '(new ' + res.importClass(bean[propName]) + '());');
 
                             break;
@@ -1236,6 +1235,7 @@ $generatorJava.clusterCaches = function (caches, res) {
  * @param pkg Package name.
  * @param useConstructor If 'true' then empty and full constructors should be generated.
  * @param includeKeyFields If 'true' then include key fields into value POJO.
+ * @param res Resulting output with generated code.
  */
 $generatorJava.javaClassCode = function (meta, key, pkg, useConstructor, includeKeyFields,
res) {
     if (!res)
@@ -1435,7 +1435,9 @@ $generatorJava.javaClassCode = function (meta, key, pkg, useConstructor,
include
 /**
  * Generate source code for type by its metadata.
  *
- * @param caches TODO.
+ * @param caches List of caches to generate POJOs for.
+ * @param useConstructor If 'true' then generate constructors.
+ * @param includeKeyFields If 'true' then include key fields into value POJO.
  */
 $generatorJava.pojos = function (caches, useConstructor, includeKeyFields) {
     var metadataNames = [];

http://git-wip-us.apache.org/repos/asf/ignite/blob/7084a90c/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-xml.js b/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
index 4f627a2..ba578aa 100644
--- a/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
+++ b/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
@@ -193,9 +193,13 @@ $generatorXml.beanProperty = function (res, bean, beanPropName, desc,
createBean
 
                             break;
                         case 'bean':
-                            res.startBlock('<property name="' + propName + '">');
-                            res.line('<bean class="' + bean[propName] + '"/>');
-                            res.endBlock('</property>');
+                            if ($commonUtils.isDefinedAndNotEmpty(bean[propName])) {
+                                res.startBlock('<property name="' + propName + '">');
+                                res.line('<bean class="' + bean[propName] + '"/>');
+                                res.endBlock('</property>');
+
+                                hasData = true;
+                            }
 
                             break;
                         default:


Mime
View raw message