ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [1/4] ignite git commit: Merge branches 'ignite-843' and 'master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-843
Date Mon, 24 Aug 2015 02:40:59 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843 6b7593d88 -> b9cd18447


http://git-wip-us.apache.org/repos/asf/ignite/blob/b9cd1844/modules/schema-import-db/src/main/java/org/apache/ignite/schema/parser/dialect/OracleMetadataDialect.java
----------------------------------------------------------------------
diff --git a/modules/schema-import-db/src/main/java/org/apache/ignite/schema/parser/dialect/OracleMetadataDialect.java
b/modules/schema-import-db/src/main/java/org/apache/ignite/schema/parser/dialect/OracleMetadataDialect.java
index 30dda5d..c569a29 100644
--- a/modules/schema-import-db/src/main/java/org/apache/ignite/schema/parser/dialect/OracleMetadataDialect.java
+++ b/modules/schema-import-db/src/main/java/org/apache/ignite/schema/parser/dialect/OracleMetadataDialect.java
@@ -31,8 +31,8 @@ public class OracleMetadataDialect extends DatabaseMetadataDialect {
     /** SQL to get columns metadata. */
     private static final String SQL_COLUMNS = "SELECT a.owner, a.table_name, a.column_name,
a.nullable," +
         " a.data_type, a.data_precision, a.data_scale " +
-        "FROM all_tab_columns a %s" +
-        " WHERE a.owner = '%s'" +
+        "FROM all_tab_columns a %s " +
+        " %s " +
         " ORDER BY a.owner, a.table_name, a.column_id";
 
     /** SQL to get list of PRIMARY KEYS columns. */
@@ -81,6 +81,36 @@ public class OracleMetadataDialect extends DatabaseMetadataDialect {
     /** Index column sort order index. */
     private static final int IDX_COL_DESCEND_IDX = 4;
 
+    /** {@inheritDoc} */
+    @Override public Set<String> systemSchemas() {
+        return new HashSet<>(Arrays.asList("ANONYMOUS", "CTXSYS", "DBSNMP", "EXFSYS",
"LBACSYS", "MDSYS", "MGMT_VIEW",
+            "OLAPSYS", "OWBSYS", "ORDPLUGINS", "ORDSYS", "OUTLN", "SI_INFORMTN_SCHEMA", "SYS",
"SYSMAN", "SYSTEM",
+            "TSMSYS", "WK_TEST", "WKSYS", "WKPROXY", "WMSYS", "XDB",
+
+            "APEX_040000", "APEX_PUBLIC_USER", "DIP", "FLOWS_30000", "FLOWS_FILES", "MDDATA",
"ORACLE_OCM",
+            "SPATIAL_CSW_ADMIN_USR", "SPATIAL_WFS_ADMIN_USR", "XS$NULL",
+
+            "BI", "HR", "OE", "PM", "IX", "SH"));
+    }
+
+    /** {@inheritDoc} */
+    @Override public List<String> schemas(Connection conn) throws SQLException {
+        List<String> schemas = new ArrayList<>();
+
+        ResultSet rs = conn.getMetaData().getSchemas();
+
+        Set<String> sysSchemas = systemSchemas();
+
+        while(rs.next()) {
+            String schema = rs.getString(1);
+
+            if (!sysSchemas.contains(schema) && !schema.startsWith("FLOWS_"))
+                schemas.add(schema);
+        }
+
+        return schemas;
+    }
+
     /**
      * @param rs Result set with column type metadata from Oracle database.
      * @return JDBC type.
@@ -225,57 +255,70 @@ public class OracleMetadataDialect extends DatabaseMetadataDialect {
     }
 
     /** {@inheritDoc} */
-    @Override public Collection<DbTable> tables(Connection conn, boolean tblsOnly)
throws SQLException {
+    @Override public Collection<DbTable> tables(Connection conn, List<String>
schemas, boolean tblsOnly)
+        throws SQLException {
         Collection<DbTable> tbls = new ArrayList<>();
 
         PreparedStatement pkStmt = conn.prepareStatement(SQL_PRIMARY_KEYS);
 
         PreparedStatement idxStmt = conn.prepareStatement(SQL_INDEXES);
 
+        if (schemas.size() == 0)
+            schemas.add(null);
+
+        Set<String> sysSchemas = systemSchemas();
+
         try (Statement colsStmt = conn.createStatement()) {
-            Collection<DbColumn> cols = new ArrayList<>();
+            for (String schema: schemas) {
+                if (systemSchemas().contains(schema) || (schema != null && schema.startsWith("FLOWS_")))
+                    continue;
 
-            Set<String> pkCols = Collections.emptySet();
-            Map<String, Map<String, Boolean>> idxs = Collections.emptyMap();
+                Collection<DbColumn> cols = new ArrayList<>();
 
-            String user = conn.getMetaData().getUserName().toUpperCase();
+                Set<String> pkCols = Collections.emptySet();
+                Map<String, Map<String, Boolean>> idxs = Collections.emptyMap();
 
-            String sql = String.format(SQL_COLUMNS,
-                tblsOnly ? "INNER JOIN all_tables b on a.table_name = b.table_name and a.owner
= b.owner" : "", user);
+                String sql = String.format(SQL_COLUMNS,
+                        tblsOnly ? "INNER JOIN all_tables b on a.table_name = b.table_name
and a.owner = b.owner" : "",
+                        schema != null ? String.format(" WHERE a.owner = '%s' ", schema)
: "");
 
-            try (ResultSet colsRs = colsStmt.executeQuery(sql)) {
-                String prevSchema = "";
-                String prevTbl = "";
+                try (ResultSet colsRs = colsStmt.executeQuery(sql)) {
+                    String prevSchema = "";
+                    String prevTbl = "";
 
-                boolean first = true;
+                    boolean first = true;
 
-                while (colsRs.next()) {
-                    String owner = colsRs.getString(OWNER_IDX);
-                    String tbl = colsRs.getString(TBL_NAME_IDX);
+                    while (colsRs.next()) {
+                        String owner = colsRs.getString(OWNER_IDX);
+                        String tbl = colsRs.getString(TBL_NAME_IDX);
 
-                    boolean changed = !owner.equals(prevSchema) || !tbl.equals(prevTbl);
+                        if (sysSchemas.contains(owner) || (schema != null && schema.startsWith("FLOWS_")))
+                            continue;
 
-                    if (changed) {
-                        if (first)
-                            first = false;
-                        else
-                            tbls.add(table(prevSchema, prevTbl, cols, idxs));
+                        boolean changed = !owner.equals(prevSchema) || !tbl.equals(prevTbl);
 
-                        prevSchema = owner;
-                        prevTbl = tbl;
-                        cols = new ArrayList<>();
-                        pkCols = primaryKeys(pkStmt, owner, tbl);
-                        idxs = indexes(idxStmt, owner, tbl);
-                    }
+                        if (changed) {
+                            if (first)
+                                first = false;
+                            else
+                                tbls.add(table(prevSchema, prevTbl, cols, idxs));
 
-                    String colName = colsRs.getString(COL_NAME_IDX);
+                            prevSchema = owner;
+                            prevTbl = tbl;
+                            cols = new ArrayList<>();
+                            pkCols = primaryKeys(pkStmt, owner, tbl);
+                            idxs = indexes(idxStmt, owner, tbl);
+                        }
 
-                    cols.add(new DbColumn(colName, decodeType(colsRs), pkCols.contains(colName),
-                        !"N".equals(colsRs.getString(NULLABLE_IDX))));
-                }
+                        String colName = colsRs.getString(COL_NAME_IDX);
 
-                if (!cols.isEmpty())
-                    tbls.add(table(prevSchema, prevTbl, cols, idxs));
+                        cols.add(new DbColumn(colName, decodeType(colsRs), pkCols.contains(colName),
+                                !"N".equals(colsRs.getString(NULLABLE_IDX))));
+                    }
+
+                    if (!cols.isEmpty())
+                        tbls.add(table(prevSchema, prevTbl, cols, idxs));
+                }
             }
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b9cd1844/modules/schema-import/src/main/java/org/apache/ignite/schema/model/PojoDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/schema-import/src/main/java/org/apache/ignite/schema/model/PojoDescriptor.java
b/modules/schema-import/src/main/java/org/apache/ignite/schema/model/PojoDescriptor.java
index 5a4a1fa..d35c934 100644
--- a/modules/schema-import/src/main/java/org/apache/ignite/schema/model/PojoDescriptor.java
+++ b/modules/schema-import/src/main/java/org/apache/ignite/schema/model/PojoDescriptor.java
@@ -493,6 +493,8 @@ public class PojoDescriptor {
             case NCHAR:
             case NVARCHAR:
             case LONGNVARCHAR:
+            case CLOB:
+            case NCLOB:
                 return String.class;
 
             case DATE:
@@ -504,10 +506,6 @@ public class PojoDescriptor {
             case TIMESTAMP:
                 return java.sql.Timestamp.class;
 
-            case CLOB:
-            case NCLOB:
-                return String.class;
-
             // BINARY, VARBINARY, LONGVARBINARY, ARRAY, BLOB, NULL, DATALINK
             // OTHER, JAVA_OBJECT, DISTINCT, STRUCT, REF, ROWID, SQLXML
             default:

http://git-wip-us.apache.org/repos/asf/ignite/blob/b9cd1844/modules/schema-import/src/main/java/org/apache/ignite/schema/model/SchemaDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/schema-import/src/main/java/org/apache/ignite/schema/model/SchemaDescriptor.java
b/modules/schema-import/src/main/java/org/apache/ignite/schema/model/SchemaDescriptor.java
new file mode 100644
index 0000000..0ab3c57
--- /dev/null
+++ b/modules/schema-import/src/main/java/org/apache/ignite/schema/model/SchemaDescriptor.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.schema.model;
+
+import javafx.beans.property.*;
+
+/**
+ * Descriptor for schema.
+ */
+public class SchemaDescriptor {
+    /** Schema name */
+    private final String schema;
+
+    /** State of schema selection. */
+    private final BooleanProperty selected;
+
+    /**
+     * Constructor of schema descriptor.
+     *
+     * @param schema Schema.
+     * @param selected Selection state.
+     */
+    public SchemaDescriptor(String schema, boolean selected) {
+        this.schema = schema;
+        this.selected = new SimpleBooleanProperty(selected);
+    }
+
+    /**
+     * @return Schema name.
+     */
+    public String schema() {
+        return schema;
+    }
+
+    /**
+     * @return Boolean property support for {@code selected} property.
+     */
+    public BooleanProperty selected() {
+        return selected;
+    }
+
+    @Override
+    public String toString() {
+        return schema;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/b9cd1844/modules/schema-import/src/main/java/org/apache/ignite/schema/parser/DatabaseMetadataParser.java
----------------------------------------------------------------------
diff --git a/modules/schema-import/src/main/java/org/apache/ignite/schema/parser/DatabaseMetadataParser.java
b/modules/schema-import/src/main/java/org/apache/ignite/schema/parser/DatabaseMetadataParser.java
index b94ace9..0a35854 100644
--- a/modules/schema-import/src/main/java/org/apache/ignite/schema/parser/DatabaseMetadataParser.java
+++ b/modules/schema-import/src/main/java/org/apache/ignite/schema/parser/DatabaseMetadataParser.java
@@ -22,29 +22,45 @@ import org.apache.ignite.schema.model.*;
 
 import java.sql.*;
 import java.util.*;
-import java.util.logging.*;
 
 /**
  * Database metadata parser.
  */
 public class DatabaseMetadataParser {
-    /** Logger. */
-    private static final Logger log = Logger.getLogger(DatabaseMetadataParser.class.getName());
+    /**
+     * Get list of schemas from database.
+     *
+     * @param conn Connection to database.
+     * @return List of schema descriptors.
+     * @throws SQLException If schemas loading failed.
+     */
+    public static ObservableList<SchemaDescriptor> schemas(Connection conn) throws
SQLException  {
+        List<String> dbSchemas = DbMetadataReader.getInstance().schemas(conn);
+
+        List<SchemaDescriptor> uiSchemas = new ArrayList<>(dbSchemas.size());
+
+        for (String schema : dbSchemas)
+            uiSchemas.add(new SchemaDescriptor(schema, false));
+
+        return FXCollections.observableList(uiSchemas);
+    }
 
     /**
      * Parse database metadata.
      *
      * @param conn Connection to database.
+     * @param schemas Collection of schema names to process.
      * @param tblsOnly If {@code true} then process tables only else process tables and views.
      * @return Collection of POJO descriptors.
      * @throws SQLException If parsing failed.
      */
-    public static ObservableList<PojoDescriptor> parse(Connection conn, boolean tblsOnly)
throws SQLException {
+    public static ObservableList<PojoDescriptor> parse(Connection conn, List<String>
schemas, boolean tblsOnly)
+        throws SQLException {
         Map<String, PojoDescriptor> parents = new HashMap<>();
 
         Map<String, Collection<PojoDescriptor>> childrens = new HashMap<>();
 
-        for (DbTable tbl : DbMetadataReader.getInstance().extractMetadata(conn, tblsOnly))
{
+        for (DbTable tbl : DbMetadataReader.getInstance().extractMetadata(conn, schemas,
tblsOnly)) {
             String schema = tbl.schema();
 
             PojoDescriptor parent = parents.get(schema);

http://git-wip-us.apache.org/repos/asf/ignite/blob/b9cd1844/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/Controls.java
----------------------------------------------------------------------
diff --git a/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/Controls.java
b/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/Controls.java
index 6c4d6bd..794fe6f 100644
--- a/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/Controls.java
+++ b/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/Controls.java
@@ -350,17 +350,40 @@ public class Controls {
      *
      * @param title Title.
      * @param node Node.
+     * @param collapsible Collapsible flag.
      * @return New {@code TitledPane} instance.
      */
-    public static TitledPane titledPane(String title, Node node) {
+    public static TitledPane titledPane(String title, Node node, boolean collapsible) {
         TitledPane tp = new TitledPane(title, node);
 
+        tp.setCollapsible(collapsible);
         tp.setExpanded(false);
 
         return tp;
     }
 
     /**
+     * Create list view.
+     *
+     * @param tip Tooltip text.
+     * @param cb Callback function for list view cell data binding.
+     * @param <T> Type of showed by viewer element.
+     * @return New {@code ListView} instance.
+     */
+    public static <T> ListView<T> list(String tip, Callback<T, ObservableValue<Boolean>>
cb) {
+        ListView lst = new ListView<>();
+
+        lst.setCellFactory(CheckBoxListCell.forListView(cb));
+
+        lst.setMinHeight(70);
+        lst.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
+
+        tooltip(lst, tip);
+
+        return lst;
+    }
+
+    /**
      * Create table column.
      *
      * @param colName Column name to display.

http://git-wip-us.apache.org/repos/asf/ignite/blob/b9cd1844/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
----------------------------------------------------------------------
diff --git a/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
b/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
index 67890fb..810fec5 100644
--- a/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
+++ b/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
@@ -198,6 +198,9 @@ public class SchemaImportApp extends Application {
     private ComboBox<String> parseCb;
 
     /** */
+    private ListView<SchemaDescriptor> schemaLst;
+
+    /** */
     private GridPaneEx connPnl;
 
     /** */
@@ -242,6 +245,8 @@ public class SchemaImportApp extends Application {
     /** */
     private ProgressIndicator pi;
 
+    private ObservableList<SchemaDescriptor> schemas = FXCollections.emptyObservableList();
+
     /** List with POJOs descriptors. */
     private ObservableList<PojoDescriptor> pojos = FXCollections.emptyObservableList();
 
@@ -312,11 +317,12 @@ public class SchemaImportApp extends Application {
     }
 
     /**
-     * Fill tree with database metadata.
+     * Open connection to database.
+     *
+     * @return Connection to database.
+     * @throws SQLException If connection failed.
      */
-    private void fill() {
-        lockUI(connLayerPnl, connPnl, nextBtn);
-
+    private Connection connect() throws SQLException {
         final String jdbcDrvJarPath = jdbcDrvJarTf.getText().trim();
 
         final String jdbcDrvCls = jdbcDrvClsTf.getText();
@@ -335,6 +341,27 @@ public class SchemaImportApp extends Application {
         if (!pwd.isEmpty())
             jdbcInfo.put("password", pwd);
 
+        return DbMetadataReader.getInstance().connect(jdbcDrvJarPath, jdbcDrvCls, jdbcUrl,
jdbcInfo);
+    }
+
+    /**
+     * Fill tree with database metadata.
+     */
+    private void fill() {
+        final List<String> selSchemas = new ArrayList<>();
+
+        for (SchemaDescriptor schema: schemas)
+            if (schema.selected().getValue())
+                selSchemas.add(schema.schema());
+
+        if (selSchemas.size() == 0)
+            if (!MessageBox.confirmDialog(owner, "No schemas selected.\nExtract tables for
all available schemas?"))
+                return;
+
+        lockUI(connLayerPnl, connPnl, nextBtn);
+
+        final String jdbcUrl = jdbcUrlTf.getText();
+
         final boolean tblsOnly = parseCb.getSelectionModel().getSelectedIndex() == 0;
 
         Runnable task = new Task<Void>() {
@@ -342,8 +369,8 @@ public class SchemaImportApp extends Application {
             @Override protected Void call() throws Exception {
                 long started = System.currentTimeMillis();
 
-                try (Connection conn = DbMetadataReader.getInstance().connect(jdbcDrvJarPath,
jdbcDrvCls, jdbcUrl, jdbcInfo)) {
-                    pojos = DatabaseMetadataParser.parse(conn, tblsOnly);
+                try (Connection conn = connect()) {
+                    pojos = DatabaseMetadataParser.parse(conn, selSchemas, tblsOnly);
                 }
 
                 perceptualDelay(started);
@@ -371,7 +398,6 @@ public class SchemaImportApp extends Application {
 
                     pojosTbl.requestFocus();
 
-
                     hdrPane.setLeft(genIcon);
 
                     titleLb.setText("Generate XML And POJOs");
@@ -409,6 +435,69 @@ public class SchemaImportApp extends Application {
     }
 
     /**
+     * Load schemas list from database.
+     */
+    private void loadSchemas() {
+        lockUI(connLayerPnl, connPnl, nextBtn);
+
+        final String jdbcUrl = jdbcUrlTf.getText();
+
+        Runnable task = new Task<Void>() {
+            /** {@inheritDoc} */
+            @Override protected Void call() throws Exception {
+                long started = System.currentTimeMillis();
+
+                try (Connection conn = connect()) {
+                    schemas = DatabaseMetadataParser.schemas(conn);
+                }
+
+                perceptualDelay(started);
+
+                return null;
+            }
+
+            /** {@inheritDoc} */
+            @Override protected void succeeded() {
+                try {
+                    super.succeeded();
+
+                    schemaLst.setItems(schemas);
+
+                    if (schemas.isEmpty()) {
+                        MessageBox.warningDialog(owner, "No schemas found in database. Recheck
JDBC URL.\n" +
+                            "JDBC URL: " +  jdbcUrl);
+
+                        return;
+                    }
+
+                    nextBtn.setDisable(false);
+                }
+                finally {
+                    unlockUI(connLayerPnl, connPnl, nextBtn);
+                }
+            }
+
+            /** {@inheritDoc} */
+            @Override protected void cancelled() {
+                super.cancelled();
+
+                unlockUI(connLayerPnl, connPnl, nextBtn);
+            }
+
+            /** {@inheritDoc} */
+            @Override protected void failed() {
+                super.succeeded();
+
+                unlockUI(connLayerPnl, connPnl, nextBtn);
+
+                MessageBox.errorDialog(owner, "Failed to get schemas list from database.",
getException());
+            }
+        };
+
+        exec.submit(task);
+    }
+
+    /**
      * Generate XML and POJOs.
      */
     private void generate() {
@@ -420,7 +509,7 @@ public class SchemaImportApp extends Application {
             return;
         }
 
-        if (checkInput(outFolderTf, true, "Output folder should not be empty!"))
+        if (!checkInput(outFolderTf, true, "Output folder should not be empty!"))
             return;
 
         lockUI(genLayerPnl, genPnl, prevBtn, nextBtn);
@@ -623,10 +712,10 @@ public class SchemaImportApp extends Application {
 
             MessageBox.warningDialog(owner, msg);
 
-            return true;
+            return false;
         }
 
-        return false;
+        return true;
     }
 
     /**
@@ -634,13 +723,11 @@ public class SchemaImportApp extends Application {
      */
     private void next() {
         if (rootPane.getCenter() == connLayerPnl) {
-            if (checkInput(jdbcDrvJarTf, true, "Path to JDBC driver is not specified!") ||
-                checkInput(jdbcDrvClsTf, true, "JDBC driver class name is not specified!")
||
-                checkInput(jdbcUrlTf, true, "JDBC URL connection string is not specified!")
||
+            if (checkInput(jdbcDrvJarTf, true, "Path to JDBC driver is not specified!") &&
+                checkInput(jdbcDrvClsTf, true, "JDBC driver class name is not specified!")
&&
+                checkInput(jdbcUrlTf, true, "JDBC URL connection string is not specified!")
&&
                 checkInput(userTf, true, "User name is not specified!"))
-                return;
-
-            fill();
+                fill();
         }
         else
             generate();
@@ -658,6 +745,9 @@ public class SchemaImportApp extends Application {
         connPnl.addColumn(100, 100, Double.MAX_VALUE, Priority.ALWAYS);
         connPnl.addColumn(35, 35, 35, Priority.NEVER);
 
+        connPnl.addRows(9);
+        connPnl.addRow(100, 100, Double.MAX_VALUE, Priority.ALWAYS);
+
         connPnl.add(text("This utility is designed to automatically generate configuration
XML files and" +
             " POJO classes from database schema information.", 550), 3);
 
@@ -729,6 +819,27 @@ public class SchemaImportApp extends Application {
 
         parseCb = connPnl.addLabeled("Parse:", comboBox("Type of tables to parse", "Tables
only", "Tables and Views"), 2);
 
+        GridPaneEx schemaPnl = paneEx(5, 5, 5, 5);
+        schemaPnl.addColumn(100, 100, Double.MAX_VALUE, Priority.ALWAYS);
+        schemaPnl.addColumn();
+
+        schemaLst = schemaPnl.add(list("Select schemas to load", new SchemaCell()));
+
+        schemaPnl.wrap();
+
+        schemaPnl.add(button("Load schemas", "Load schemas for specified database", new EventHandler<ActionEvent>()
{
+            @Override
+            public void handle(ActionEvent evt) {
+                loadSchemas();
+            }
+        }));
+
+        TitledPane titledPnl = connPnl.add(titledPane("Schemas", schemaPnl, false), 3);
+
+        titledPnl.setExpanded(true);
+
+        GridPaneEx.setValignment(titledPnl, VPos.TOP);
+
         connLayerPnl = stackPane(connPnl);
 
         return connLayerPnl;
@@ -936,7 +1047,7 @@ public class SchemaImportApp extends Application {
                     " with the given replacement",
                 new EventHandler<ActionEvent>() {
                     @Override public void handle(ActionEvent evt) {
-                        if (checkInput(regexTf, false, "Regular expression should not be
empty!"))
+                        if (!checkInput(regexTf, false, "Regular expression should not be
empty!"))
                             return;
 
                         String sel = replaceCb.getSelectionModel().getSelectedItem();
@@ -1086,7 +1197,7 @@ public class SchemaImportApp extends Application {
         });
 
         genPnl.add(titledPane("Rename \"Key class name\", \"Value class name\" or  \"Java
name\" for selected tables",
-            regexPnl), 3);
+            regexPnl, true), 3);
 
         genLayerPnl = stackPane(genPnl);
     }
@@ -1597,6 +1708,16 @@ public class SchemaImportApp extends Application {
     }
 
     /**
+     * Special list view cell to select loaded schemas.
+     */
+    private static class SchemaCell implements Callback<SchemaDescriptor, ObservableValue<Boolean>>
{
+        @Override
+        public ObservableValue<Boolean> call(SchemaDescriptor item) {
+            return item.selected();
+        }
+    }
+
+    /**
      * Special table cell to select schema or table.
      */
     private static class PojoDescriptorCell extends TableCell<PojoDescriptor, Boolean>
{

http://git-wip-us.apache.org/repos/asf/ignite/blob/b9cd1844/modules/schema-import/src/test/java/org/apache/ignite/schema/test/AbstractSchemaImportTest.java
----------------------------------------------------------------------
diff --git a/modules/schema-import/src/test/java/org/apache/ignite/schema/test/AbstractSchemaImportTest.java
b/modules/schema-import/src/test/java/org/apache/ignite/schema/test/AbstractSchemaImportTest.java
index 0c3ecb1..b9b9c76 100644
--- a/modules/schema-import/src/test/java/org/apache/ignite/schema/test/AbstractSchemaImportTest.java
+++ b/modules/schema-import/src/test/java/org/apache/ignite/schema/test/AbstractSchemaImportTest.java
@@ -19,13 +19,13 @@ package org.apache.ignite.schema.test;
 
 import junit.framework.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.schema.model.PojoDescriptor;
-import org.apache.ignite.schema.parser.DatabaseMetadataParser;
+import org.apache.ignite.schema.model.*;
+import org.apache.ignite.schema.parser.*;
 import org.apache.ignite.schema.ui.*;
 
 import java.io.*;
 import java.sql.*;
-import java.util.List;
+import java.util.*;
 
 import static org.apache.ignite.schema.ui.MessageBox.Result.*;
 
@@ -93,7 +93,9 @@ public abstract class AbstractSchemaImportTest extends TestCase {
 
         U.closeQuiet(stmt);
 
-        pojos = DatabaseMetadataParser.parse(conn, false);
+        List<String> schemas = new ArrayList<>();
+
+        pojos = DatabaseMetadataParser.parse(conn, schemas, false);
 
         U.closeQuiet(conn);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/b9cd1844/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
index c456339..8b4f3f9 100644
--- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
@@ -57,17 +57,11 @@ public class CacheJdbcPojoStoreFactorySelfTest extends GridCommonAbstractTest
{
      * @throws Exception If failed.
      */
     public void testSerializable() throws Exception {
-        GridTestUtils.assertThrows(log, new Callable<Object>() {
-            @Override public Object call() throws Exception {
-                try (Ignite ignite = Ignition.start("modules/spring/src/test/config/node.xml"))
{
-                    try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(cacheConfigurationH2Dialect()))
{
-                        checkStore(cache, JdbcDataSource.class);
-                    }
-                }
-
-                return null;
+        try (Ignite ignite = Ignition.start("modules/spring/src/test/config/node.xml")) {
+            try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(cacheConfigurationH2Dialect()))
{
+                checkStore(cache, JdbcDataSource.class);
             }
-        }, CacheException.class, "Failed to validate cache configuration. Cache store factory
is not serializable.");
+        }
     }
 
     /**


Mime
View raw message