ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-843 WIP on preview java code.
Date Thu, 27 Aug 2015 10:49:57 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843 c37f4af00 -> b1405b5fe


IGNITE-843 WIP on preview java code.


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

Branch: refs/heads/ignite-843
Commit: b1405b5fe6467fe2031c2bfe33a513000c09a27e
Parents: c37f4af
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Thu Aug 27 17:50:20 2015 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Thu Aug 27 17:50:20 2015 +0700

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


http://git-wip-us.apache.org/repos/asf/ignite/blob/b1405b5f/modules/control-center-web/src/main/js/routes/generator/generator-common.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-common.js b/modules/control-center-web/src/main/js/routes/generator/generator-common.js
index dd96ac0..c51a047 100644
--- a/modules/control-center-web/src/main/js/routes/generator/generator-common.js
+++ b/modules/control-center-web/src/main/js/routes/generator/generator-common.js
@@ -189,10 +189,10 @@ $generatorCommon.JDBC_DIALECTS = {
     H2: 'org.apache.ignite.cache.store.jdbc.dialect.H2Dialect'
 };
 
-$generatorCommon.jdbcDialectClassName = function(dialect) {
-    var dialectClsName = $generatorCommon.JDBC_DIALECTS[dialect];
+$generatorCommon.jdbcDialectClassName = function(db) {
+    var dialectClsName = $generatorCommon.JDBC_DIALECTS[db];
 
-    return dialectClsName ? dialectClsName : 'Unknown JDBC dialect: ' + dialect;
+    return dialectClsName ? dialectClsName : 'Unknown database: ' + db;
 };
 
 $generatorCommon.DATA_SOURCES = {
@@ -204,6 +204,12 @@ $generatorCommon.DATA_SOURCES = {
     H2: 'org.h2.jdbcx.JdbcDataSource'
 };
 
+$generatorCommon.dataSourceClassName = function(db) {
+    var dsClsName = $generatorCommon.DATA_SOURCES[db];
+
+    return dsClsName ? dsClsName : 'Unknown database: ' + db;
+};
+
 $generatorCommon.STORE_FACTORIES = {
     CacheJdbcPojoStoreFactory: {
         className: 'org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory',

http://git-wip-us.apache.org/repos/asf/ignite/blob/b1405b5f/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 115bdba..448301a 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
@@ -286,7 +286,9 @@ $generatorJava._addBeanWithProperties = function (res, varName, bean,
beanPropNa
             res.line();
         }
 
-        res.line(beanClass + ' ' + beanVarName + ' = new ' + beanClass + '();');
+        var clsName = res.importClass(beanClass);
+
+        res.line(clsName + ' ' + beanVarName + ' = new ' + clsName + '();');
 
         for (var propName in props) {
             if (props.hasOwnProperty(propName)) {
@@ -299,7 +301,7 @@ $generatorJava._addBeanWithProperties = function (res, varName, bean,
beanPropNa
                             break;
 
                         case 'enum':
-                            $generatorJava._addProperty(res, beanVarName, bean, propName,
descr.enumClass, descr.setterName);
+                            $generatorJava._addProperty(res, beanVarName, bean, propName,
res.importClass(descr.enumClass), descr.setterName);
                             break;
 
                         case 'float':
@@ -354,7 +356,7 @@ $generatorJava._addBeanWithProperties = function (res, varName, bean,
beanPropNa
     else if (createBeanAlthoughNoProps) {
         res.emptyLineIfNeeded();
 
-        res.line(varName + '.' + $generatorJava._setterName(beanPropName) + '(new ' + beanClass
+ '());');
+        res.line(varName + '.' + $generatorJava._setterName(beanPropName) + '(new ' + res.importClass(beanClass)
+ '());');
     }
 };
 
@@ -836,11 +838,11 @@ $generatorJava.cacheStore = function (cache, varName, res) {
                 if (!_.contains(res.datasources, dataSourceBean)) {
                     res.datasources.push(dataSourceBean);
 
-                    var dataSource = $generatorCommon.DATA_SOURCES[storeFactory.dialect];
+                    var dsClsName = $generatorCommon.dataSourceClassName(storeFactory.dialect);
 
                     res.line();
 
-                    $generatorJava._declareVariable(res, true, dsVarName, dataSource);
+                    $generatorJava._declareVariable(res, true, dsVarName, dsClsName);
 
                     res.line(dsVarName + '.setURL(_URL_);');
                     res.line(dsVarName + '.setUsername(_User_Name_);');


Mime
View raw message