ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [20/59] [abbrv] incubator-ignite git commit: # IGNITE-32: Refactored types metadata to cache package from.
Date Thu, 05 Feb 2015 09:05:18 GMT
# IGNITE-32: Refactored types metadata to cache package from.


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

Branch: refs/heads/ignite-103
Commit: ed2af98cff847f39067fd9c8a2fdb7879e7cf31b
Parents: 8e5c0a8
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Tue Feb 3 13:19:36 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Tue Feb 3 13:19:36 2015 +0700

----------------------------------------------------------------------
 .../apache/ignite/cache/CacheConfiguration.java |  23 ++
 .../ignite/cache/CacheTypeFieldMetadata.java    | 145 +++++++++
 .../apache/ignite/cache/CacheTypeMetadata.java  | 156 ++++++++++
 .../query/CacheQueryTableColumnMetadata.java    | 143 ---------
 .../cache/query/CacheQueryTableMetadata.java    | 134 ---------
 .../cache/query/CacheQueryTypeMetadata.java     |  59 +---
 .../ignite/cache/store/jdbc/JdbcCacheStore.java | 145 +++++----
 .../cache/store/jdbc/JdbcPojoCacheStore.java    |  22 +-
 .../core/src/test/config/store/jdbc/Ignite.xml  | 252 +++++-----------
 ...ractJdbcCacheStoreMultithreadedSelfTest.java |   9 +-
 .../store/jdbc/PojoJdbcCacheStoreTest.java      |   7 +-
 .../cache/store/jdbc/model/Organization.java    |   2 +-
 .../cache/store/jdbc/model/OrganizationKey.java |   2 +-
 .../ignite/cache/store/jdbc/model/Person.java   |   2 +-
 .../cache/store/jdbc/model/PersonKey.java       |   2 +-
 .../ignite/schema/generator/PojoGenerator.java  |   2 +-
 .../ignite/schema/generator/XmlGenerator.java   | 100 +------
 .../ignite/schema/model/PojoDescriptor.java     |  65 -----
 .../schema/parser/DatabaseMetadataParser.java   |  45 +--
 .../apache/ignite/schema/parser/DbTable.java    |  39 +--
 .../parser/dialect/JdbcMetadataDialect.java     |  40 +--
 .../parser/dialect/OracleMetadataDialect.java   |  66 ++---
 .../apache/ignite/schema/load/model/Ignite.xml  | 292 +++++++------------
 23 files changed, 651 insertions(+), 1101 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/core/src/main/java/org/apache/ignite/cache/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheConfiguration.java
index d5edb86..95d6a43 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheConfiguration.java
@@ -344,6 +344,9 @@ public class CacheConfiguration extends MutableConfiguration {
      */
     private boolean readFromBackup = DFLT_READ_FROM_BACKUP;
 
+    /** Collection of type metadata. */
+    private Collection<CacheTypeMetadata> typeMeta;
+
     /** Empty constructor (all values are initialized to their defaults). */
     public CacheConfiguration() {
         /* No-op. */
@@ -427,6 +430,7 @@ public class CacheConfiguration extends MutableConfiguration {
         writeBehindFlushSize = cc.getWriteBehindFlushSize();
         writeBehindFlushThreadCnt = cc.getWriteBehindFlushThreadCount();
         writeSync = cc.getWriteSynchronizationMode();
+        typeMeta = cc.getTypeMetadata();
     }
 
     /**
@@ -1751,6 +1755,25 @@ public class CacheConfiguration extends MutableConfiguration {
     }
 
     /**
+     * Gets collection of type metadata objects.
+     *
+     * @return Collection of type metadata.
+     */
+    public Collection<CacheTypeMetadata> getTypeMetadata() {
+        return typeMeta;
+    }
+
+    /**
+     * Sets collection of type metadata objects.
+     *
+     * @param typeMeta Collection of type metadata.
+     */
+    public void setTypeMetadata(Collection<CacheTypeMetadata> typeMeta) {
+        this.typeMeta = typeMeta;
+    }
+
+
+    /**
      * Gets query configuration. Query configuration defines which fields should be indexed for objects
      * without annotations or portable objects.
      *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeFieldMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeFieldMetadata.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeFieldMetadata.java
new file mode 100644
index 0000000..687c97d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeFieldMetadata.java
@@ -0,0 +1,145 @@
+/*
+ * 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.cache;
+
+import org.apache.ignite.internal.util.typedef.internal.*;
+
+/**
+ * Type field metadata.
+ */
+public class CacheTypeFieldMetadata {
+    /** Column name in database. */
+    private String dbName;
+
+    /** Column JDBC type in database. */
+    private int dbType;
+
+    /** Column name in database. */
+    private String javaName;
+
+    /** Corresponding java type. */
+    private Class<?> javaType;
+
+    /**
+     * Default constructor.
+     */
+    public CacheTypeFieldMetadata() {
+        // No-op.
+    }
+
+    /**
+     * Full constructor.
+     *
+     * @param dbName Column name in database.
+     * @param dbType Column JDBC type in database.
+     * @param javaName Field name in java object.
+     * @param javaType Field java type.
+     */
+    public CacheTypeFieldMetadata(String javaName, Class<?> javaType, String dbName, int dbType) {
+        this.dbName = dbName;
+        this.dbType = dbType;
+        this.javaName = javaName;
+        this.javaType = javaType;
+    }
+
+    /**
+     * @return Column name in database.
+     */
+    public String getDbName() {
+        return dbName;
+    }
+
+    /**
+     * @param dbName Column name in database.
+     */
+    public void setDbName(String dbName) {
+        this.dbName = dbName;
+    }
+
+    /**
+     * @return Column JDBC type in database.
+     */
+    public int getDbType() {
+        return dbType;
+    }
+
+    /**
+     * @param dbType Column JDBC type in database.
+     */
+    public void setDbType(int dbType) {
+        this.dbType = dbType;
+    }
+
+    /**
+     * @return Field name in java object.
+     */
+    public String getJavaName() {
+        return javaName;
+    }
+
+    /**
+     * @param javaName Field name in java object.
+     */
+    public void setJavaName(String javaName) {
+        this.javaName = javaName;
+    }
+
+    /**
+     * @return Field java type.
+     */
+    public Class<?> getJavaType() {
+        return javaType;
+    }
+
+    /**
+     * @param javaType Corresponding java type.
+     */
+    public void setJavaType(Class<?> javaType) {
+        this.javaType = javaType;
+    }
+
+     /** {@inheritDoc} */
+    @Override public boolean equals(Object o) {
+        if (this == o)
+            return true;
+
+        if (!(o instanceof CacheTypeFieldMetadata))
+            return false;
+
+        CacheTypeFieldMetadata that = (CacheTypeFieldMetadata)o;
+
+        return javaName.equals(that.javaName) && dbName.equals(that.dbName) &&
+            javaType == that.javaType && dbType == that.dbType;
+    }
+
+    /** {@inheritDoc} */
+    @Override public int hashCode() {
+        int res = dbName.hashCode();
+
+        res = 31 * res + dbType;
+        res = 31 * res + javaName.hashCode();
+        res = 31 * res + javaType.hashCode();
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(CacheTypeFieldMetadata.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
new file mode 100644
index 0000000..3a644f8
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
@@ -0,0 +1,156 @@
+/*
+ * 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.cache;
+
+import org.apache.ignite.internal.util.tostring.*;
+
+import java.util.*;
+
+/**
+ * Type metadata.
+ */
+public class CacheTypeMetadata {
+    /** Schema name in database. */
+    private String dbSchema;
+
+    /** Table name in database. */
+    private String dbTbl;
+
+    /** Key class used to store key in cache. */
+    private String keyType;
+
+    /** Value class used to store value in cache. */
+    private String valType;
+
+    /** Key fields. */
+    @GridToStringInclude
+    private Collection<CacheTypeFieldMetadata> keyFields;
+
+    /** Value fields . */
+    @GridToStringInclude
+    private Collection<CacheTypeFieldMetadata> valFields;
+
+    /**
+     * Gets database schema name.
+     *
+     * @return Schema name.
+     */
+    public String getDatabaseSchema() {
+        return dbSchema;
+    }
+
+    /**
+     * Sets database schema name.
+     *
+     * @param dbSchema Schema name.
+     */
+    public void setDatabaseSchema(String dbSchema) {
+        this.dbSchema = dbSchema;
+    }
+
+    /**
+     * Gets table name in database.
+     *
+     * @return Table name in database.
+     */
+    public String getDatabaseTable() {
+        return dbTbl;
+    }
+
+    /**
+     * Table name in database.
+     *
+     * @param dbTbl Table name in database.
+     */
+    public void setDatabaseTable(String dbTbl) {
+        this.dbTbl = dbTbl;
+    }
+
+    /**
+     * Gets key type.
+     *
+     * @return Key type.
+     */
+    public String getKeyType() {
+        return keyType;
+    }
+
+    /**
+     * Sets key type.
+     *
+     * @param keyType Key type.
+     */
+    public void setKeyType(String keyType) {
+        this.keyType = keyType;
+    }
+
+
+    /**
+     * Gets value type.
+     *
+     * @return Key type.
+     */
+    public String getValueType() {
+        return valType;
+    }
+
+    /**
+     * Sets value type.
+     *
+     * @param valType Value type.
+     */
+    public void setValueType(String valType) {
+        this.valType = valType;
+    }
+
+    /**
+     * Gets key fields.
+     *
+     * @return Key fields.
+     */
+    public Collection<CacheTypeFieldMetadata> getKeyFields() {
+        return keyFields;
+    }
+
+    /**
+     * Sets key fields.
+     *
+     * @param keyFields New key fields.
+     */
+    public void setKeyFields(Collection<CacheTypeFieldMetadata> keyFields) {
+        this.keyFields = keyFields;
+    }
+
+    /**
+     * Gets value fields.
+     *
+     * @return Value fields.
+     */
+    public Collection<CacheTypeFieldMetadata> getValueFields() {
+        return valFields;
+    }
+
+    /**
+     * Sets value fields.
+     *
+     * @param valFields New value fields.
+     */
+    public void setValueFields(Collection<CacheTypeFieldMetadata> valFields) {
+        this.valFields = valFields;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTableColumnMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTableColumnMetadata.java b/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTableColumnMetadata.java
deleted file mode 100644
index 059cc8b..0000000
--- a/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTableColumnMetadata.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * 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.cache.query;
-
-import org.apache.ignite.internal.util.typedef.internal.*;
-
-/**
- * Database table column metadata.
- */
-public class CacheQueryTableColumnMetadata {
-    /** Column name in database. */
-    private String dbName;
-
-    /** Column JDBC type in database. */
-    private int dbType;
-
-    /** Column name in database. */
-    private String javaName;
-
-    /** Corresponding java type. */
-    private Class<?> javaType;
-
-    /**
-     * Default constructor.
-     */
-    public CacheQueryTableColumnMetadata() {
-        // No-op.
-    }
-
-    /**
-     * @param dbName Column name in database.
-     * @param dbType Column JDBC type in database.
-     * @param javaName Field name in java object.
-     * @param javaType Field java type.
-     */
-    public CacheQueryTableColumnMetadata(String javaName, Class<?> javaType, String dbName, int dbType) {
-        this.dbName = dbName;
-        this.dbType = dbType;
-        this.javaName = javaName;
-        this.javaType = javaType;
-    }
-
-    /**
-     * @return Column name in database.
-     */
-    public String getDbName() {
-        return dbName;
-    }
-
-    /**
-     * @param dbName Column name in database.
-     */
-    public void setDbName(String dbName) {
-        this.dbName = dbName;
-    }
-
-    /**
-     * @return Column JDBC type in database.
-     */
-    public int getDbType() {
-        return dbType;
-    }
-
-    /**
-     * @param dbType Column JDBC type in database.
-     */
-    public void setDbType(int dbType) {
-        this.dbType = dbType;
-    }
-
-    /**
-     * @return Field name in java object.
-     */
-    public String getJavaName() {
-        return javaName;
-    }
-
-    /**
-     * @param javaName Field name in java object.
-     */
-    public void setJavaName(String javaName) {
-        this.javaName = javaName;
-    }
-
-    /**
-     * @return Field java type.
-     */
-    public Class<?> getJavaType() {
-        return javaType;
-    }
-
-    /**
-     * @param javaType Corresponding java type.
-     */
-    public void setJavaType(Class<?> javaType) {
-        this.javaType = javaType;
-    }
-
-     /** {@inheritDoc} */
-    @Override public boolean equals(Object o) {
-        if (this == o)
-            return true;
-
-        if (!(o instanceof CacheQueryTableColumnMetadata))
-            return false;
-
-        CacheQueryTableColumnMetadata that = (CacheQueryTableColumnMetadata)o;
-
-        return javaName.equals(that.javaName) && dbName.equals(that.dbName) &&
-            javaType == that.javaType && dbType == that.dbType;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int hashCode() {
-        int res = dbName.hashCode();
-
-        res = 31 * res + dbType;
-        res = 31 * res + javaName.hashCode();
-        res = 31 * res + javaType.hashCode();
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(CacheQueryTableColumnMetadata.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTableMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTableMetadata.java b/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTableMetadata.java
deleted file mode 100644
index 13e584e..0000000
--- a/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTableMetadata.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * 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.cache.query;
-
-import org.apache.ignite.internal.util.tostring.*;
-
-import java.util.*;
-
-/**
- * Database table metadata.
- */
-public class CacheQueryTableMetadata {
-    /** Schema name in database. */
-    private String schema;
-
-    /** Table name in database. */
-    private String tbl;
-
-    /** Key columns. */
-    @GridToStringInclude
-    private Collection<CacheQueryTableColumnMetadata> keyCols;
-
-    /** Value columns . */
-    @GridToStringInclude
-    private Collection<CacheQueryTableColumnMetadata> valCols;
-
-    /**
-     * Default constructor.
-     */
-    public CacheQueryTableMetadata() {
-        keyCols = new ArrayList<>();
-        valCols = new ArrayList<>();
-    }
-
-    /**
-     * Copy constructor.
-     *
-     * @param src Source table metadata.
-     */
-    public CacheQueryTableMetadata(CacheQueryTableMetadata src) {
-        schema = src.getSchema();
-        tbl = src.getTable();
-
-        keyCols = new ArrayList<>(src.getKeyColumns());
-        valCols = new ArrayList<>(src.getValueColumns());
-    }
-
-    /**
-     * Gets database schema name.
-     *
-     * @return Schema name.
-     */
-    public String getSchema() {
-        return schema;
-    }
-
-    /**
-     * Sets database schema name.
-     *
-     * @param schema Schema name.
-     */
-    public void setSchema(String schema) {
-        this.schema = schema;
-    }
-
-    /**
-     * Gets table name in database.
-     *
-     * @return Table name in database.
-     */
-    public String getTable() {
-        return tbl;
-    }
-
-    /**
-     * Table name in database.
-     *
-     * @param tbl Table name in database.
-     */
-    public void setTable(String tbl) {
-        this.tbl = tbl;
-    }
-
-    /**
-     * Gets key columns.
-     *
-     * @return Key columns.
-     */
-    public Collection<CacheQueryTableColumnMetadata> getKeyColumns() {
-        return keyCols;
-    }
-
-    /**
-     * Sets key columns.
-     *
-     * @param keyCols New key columns.
-     */
-    public void setKeyColumns(Collection<CacheQueryTableColumnMetadata> keyCols) {
-        this.keyCols = keyCols;
-    }
-
-    /**
-     * Gets value columns.
-     *
-     * @return Value columns.
-     */
-    public Collection<CacheQueryTableColumnMetadata> getValueColumns() {
-        return valCols;
-    }
-
-    /**
-     * Sets value columns.
-     *
-     * @param valCols New value columns.
-     */
-    public void setValueColumns(Collection<CacheQueryTableColumnMetadata> valCols) {
-        this.valCols = valCols;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTypeMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTypeMetadata.java b/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTypeMetadata.java
index e866f19..55dc102 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTypeMetadata.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTypeMetadata.java
@@ -17,9 +17,9 @@
 
 package org.apache.ignite.cache.query;
 
-import org.apache.ignite.lang.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
 
 import java.util.*;
 
@@ -27,15 +27,8 @@ import java.util.*;
  * Cache query type metadata.
  */
 public class CacheQueryTypeMetadata {
-    /** Key class used to store value in cache. */
-    private String keyType;
-
     /** Type name, e.g. class name. */
-    private String valType;
-
-    // TODO MOVE to cache or store config ?
-    /** Database table metadata.*/
-    private CacheQueryTableMetadata tblMeta;
+    private String type;
 
     /** Fields to be queried, in addition to indexed fields. */
     @GridToStringInclude
@@ -61,8 +54,6 @@ public class CacheQueryTypeMetadata {
      * Default constructor.
      */
     public CacheQueryTypeMetadata() {
-        tblMeta = new CacheQueryTableMetadata();
-
         qryFlds = new LinkedHashMap<>();
 
         ascFlds = new LinkedHashMap<>();
@@ -78,11 +69,7 @@ public class CacheQueryTypeMetadata {
      * Copy constructor.
      */
     public CacheQueryTypeMetadata(CacheQueryTypeMetadata src) {
-        keyType = src.getKeyType();
-
-        valType = src.getType();
-
-        tblMeta = new CacheQueryTableMetadata(src.getTableMetadata());
+        type = src.getType();
 
         qryFlds = new LinkedHashMap<>(src.getQueryFields());
 
@@ -96,30 +83,12 @@ public class CacheQueryTypeMetadata {
     }
 
     /**
-     * Gets key type.
-     *
-     * @return Key type.
-     */
-    public String getKeyType() {
-        return keyType;
-    }
-
-    /**
-     * Sets key type.
-     *
-     * @param keyType Key type.
-     */
-    public void setKeyType(String keyType) {
-        this.keyType = keyType;
-    }
-
-    /**
      * Gets type (e.g. class name).
      *
      * @return Type name.
      */
     public String getType() {
-        return valType;
+        return type;
     }
 
     /**
@@ -137,25 +106,7 @@ public class CacheQueryTypeMetadata {
      * @param type Type name.
      */
     public void setType(String type) {
-        valType = type;
-    }
-
-    /**
-     * Gets table metadata.
-     *
-     * @return table metadata.
-     */
-    public CacheQueryTableMetadata getTableMetadata() {
-        return tblMeta;
-    }
-
-    /**
-     * Sets table metadata.
-     *
-     * @param tblMeta New table metadata.
-     */
-    public void setTableMetadata(CacheQueryTableMetadata tblMeta) {
-        this.tblMeta = tblMeta;
+        this.type = type;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcCacheStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcCacheStore.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcCacheStore.java
index 33461b7..2147e3f 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcCacheStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcCacheStore.java
@@ -18,7 +18,7 @@
 package org.apache.ignite.cache.store.jdbc;
 
 import org.apache.ignite.*;
-import org.apache.ignite.cache.query.*;
+import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.store.*;
 import org.apache.ignite.cache.store.jdbc.dialect.*;
 import org.apache.ignite.internal.util.tostring.*;
@@ -132,7 +132,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
      * @param rs ResultSet.
      * @return Constructed object.
      */
-    protected abstract <R> R buildObject(String typeName, Collection<CacheQueryTableColumnMetadata> fields, ResultSet rs)
+    protected abstract <R> R buildObject(String typeName, Collection<CacheTypeFieldMetadata> fields, ResultSet rs)
         throws CacheLoaderException;
 
     /**
@@ -157,7 +157,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
      * @param types Collection of types.
      * @throws CacheException If failed to prepare.
      */
-    protected abstract void prepareBuilders(@Nullable String cacheName, Collection<CacheQueryTypeMetadata> types)
+    protected abstract void prepareBuilders(@Nullable String cacheName, Collection<CacheTypeMetadata> types)
         throws CacheException;
 
     /**
@@ -402,19 +402,19 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
             if (entryMappings != null)
                 return entryMappings;
 
-            Collection<CacheQueryTypeMetadata> typeMetadata =
-                ignite().cache(session().cacheName()).configuration().getQueryConfiguration().getTypeMetadata();
+            Collection<CacheTypeMetadata> types = ignite().cache(session().cacheName()).configuration()
+                .getTypeMetadata();
 
-            entryMappings = U.newHashMap(typeMetadata.size());
+            entryMappings = U.newHashMap(types.size());
 
-            for (CacheQueryTypeMetadata type : typeMetadata)
+            for (CacheTypeMetadata type : types)
                 entryMappings.put(keyTypeId(type.getKeyType()), new EntryMapping(dialect, type));
 
             Map<String, Map<Object, EntryMapping>> mappings = new HashMap<>(cacheMappings);
 
             mappings.put(cacheName, entryMappings);
 
-            prepareBuilders(cacheName, typeMetadata);
+            prepareBuilders(cacheName, types);
 
             cacheMappings = mappings;
 
@@ -632,10 +632,20 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
                     insStmt.executeUpdate();
                 }
                 catch (SQLException e) {
+                    String sqlState = e.getSQLState();
+
+                    SQLException nested = e.getNextException();
+
+                    while (sqlState == null && nested != null) {
+                        sqlState = nested.getSQLState();
+
+                        nested = nested.getNextException();
+                    }
+
                     // The error with code 23505 is thrown when trying to insert a row that
                     // would violate a unique index or primary key.
                     // TODO check with all RDBMS
-                    if (e.getErrorCode() == 23505)
+                    if (sqlState != null && Integer.valueOf(sqlState) == 23505)
                         continue;
 
                     throw e;
@@ -708,7 +718,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
     }
 
     /** {@inheritDoc} */
-    @Override public void writeAll(Collection<Cache.Entry<? extends K, ? extends V>> entries)
+    @Override public void writeAll(final Collection<Cache.Entry<? extends K, ? extends V>> entries)
         throws CacheWriterException {
         assert entries != null;
 
@@ -723,6 +733,12 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
                 PreparedStatement mergeStmt = null;
 
                 try {
+                    LazyValue<Object[]> lazyEntries = new LazyValue<Object[]>() {
+                        @Override public Object[] create() {
+                            return entries.toArray();
+                        }
+                    };
+
                     int fromIdx = 0, prepared = 0;
 
                     for (Cache.Entry<? extends K, ? extends V> entry : entries) {
@@ -734,7 +750,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
 
                         if (currKeyTypeId == null || !currKeyTypeId.equals(keyTypeId)) {
                             if (mergeStmt != null) {
-                                executeBatch(mergeStmt, "writeAll", fromIdx, prepared, entries);
+                                executeBatch(mergeStmt, "writeAll", fromIdx, prepared, lazyEntries);
 
                                 U.closeQuiet(mergeStmt);
                             }
@@ -753,14 +769,14 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
                         mergeStmt.addBatch();
 
                         if (++prepared % batchSz == 0) {
-                            executeBatch(mergeStmt, "writeAll", fromIdx, prepared, entries);
+                            executeBatch(mergeStmt, "writeAll", fromIdx, prepared, lazyEntries);
 
                             prepared = 0;
                         }
                     }
 
                     if (mergeStmt != null && prepared % batchSz != 0)
-                        executeBatch(mergeStmt, "writeAll", fromIdx, prepared, entries);
+                        executeBatch(mergeStmt, "writeAll", fromIdx, prepared, lazyEntries);
                 }
                 finally {
                     U.closeQuiet(mergeStmt);
@@ -845,9 +861,9 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
      * @param stmtType Statement description for error message.
      * @param fromIdx Objects in batch start from index.
      * @param prepared Expected objects in batch.
-     * @param objects All objects.
+     * @param lazyObjs All objects used in batch statement as array.
      */
-    private void executeBatch(Statement stmt, String stmtType, int fromIdx, int prepared, Collection<?> objects)
+    private void executeBatch(Statement stmt, String stmtType, int fromIdx, int prepared, LazyValue<Object[]> lazyObjs)
         throws SQLException {
         int[] rowCounts = stmt.executeBatch();
 
@@ -857,19 +873,16 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
             log.warning("JDBC driver did not return the expected number of updated row counts," +
                 " actual row count: " + numOfRowCnt + " expected: " + prepared);
 
-        Object[] arr = null;
-
         for (int i = 0; i < numOfRowCnt; i++)
             if (rowCounts[i] != 1) {
-                if (arr == null)
-                    arr = objects.toArray();
+                Object[] objs = lazyObjs.value();
 
-                log.warning("Batch " + stmtType + " returned unexpected updated row count for: " + arr[fromIdx + i]);
+                log.warning("Batch " + stmtType + " returned unexpected updated row count for: " + objs[fromIdx + i]);
             }
     }
 
     /** {@inheritDoc} */
-    @Override public void deleteAll(Collection<?> keys) throws CacheWriterException {
+    @Override public void deleteAll(final Collection<?> keys) throws CacheWriterException {
         assert keys != null;
 
         Connection conn = null;
@@ -881,6 +894,12 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
 
             PreparedStatement delStmt = null;
 
+            LazyValue<Object[]> lazyKeys = new LazyValue<Object[]>() {
+                @Override public Object[] create() {
+                    return keys.toArray();
+                }
+            };
+
             int fromIdx = 0, prepared = 0;
 
             for (Object key : keys) {
@@ -895,7 +914,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
                 }
 
                 if (!currKeyTypeId.equals(keyTypeId)) {
-                    executeBatch(delStmt, "deleteAll", fromIdx, prepared, keys);
+                    executeBatch(delStmt, "deleteAll", fromIdx, prepared, lazyKeys);
 
                     fromIdx += prepared;
 
@@ -909,7 +928,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
                 delStmt.addBatch();
 
                 if (++prepared % batchSz == 0) {
-                    executeBatch(delStmt, "deleteAll", fromIdx, prepared, keys);
+                    executeBatch(delStmt, "deleteAll", fromIdx, prepared, lazyKeys);
 
                     fromIdx += prepared;
 
@@ -918,7 +937,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
             }
 
             if (delStmt != null && prepared % batchSz != 0)
-                executeBatch(delStmt, "deleteAll", fromIdx, prepared, keys);
+                executeBatch(delStmt, "deleteAll", fromIdx, prepared, lazyKeys);
         }
         catch (SQLException e) {
             throw new CacheWriterException("Failed to remove values from database", e);
@@ -937,7 +956,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
      */
     protected int fillKeyParameters(PreparedStatement stmt, int i, EntryMapping type,
         Object key) throws CacheException {
-        for (CacheQueryTableColumnMetadata field : type.keyColumns()) {
+        for (CacheTypeFieldMetadata field : type.keyColumns()) {
             Object fieldVal = extractField(type.keyType(), field.getJavaName(), key);
 
             try {
@@ -973,7 +992,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
      */
     protected int fillValueParameters(PreparedStatement stmt, int i, EntryMapping m, Object val)
         throws CacheWriterException {
-        for (CacheQueryTableColumnMetadata field : m.uniqValFields) {
+        for (CacheTypeFieldMetadata field : m.uniqValFields) {
             Object fieldVal = extractField(m.valueType(), field.getJavaName(), val);
 
             try {
@@ -1117,37 +1136,32 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
         private final Collection<String> cols;
 
         /** Unique value fields. */
-        private final Collection<CacheQueryTableColumnMetadata> uniqValFields;
+        private final Collection<CacheTypeFieldMetadata> uniqValFields;
 
         /** Type metadata. */
-        private final CacheQueryTypeMetadata typeMeta;
-
-        /** Table metadata. */
-        private final CacheQueryTableMetadata tblMeta;
+        private final CacheTypeMetadata typeMeta;
 
         /**
          * @param typeMeta Type metadata.
          */
-        public EntryMapping(JdbcDialect dialect, CacheQueryTypeMetadata typeMeta) {
+        public EntryMapping(JdbcDialect dialect, CacheTypeMetadata typeMeta) {
             this.dialect = dialect;
 
             this.typeMeta = typeMeta;
 
-            tblMeta = typeMeta.getTableMetadata();
-
-            final Collection<CacheQueryTableColumnMetadata> keyFields = tblMeta.getKeyColumns();
+            final Collection<CacheTypeFieldMetadata> keyFields = typeMeta.getKeyFields();
 
-            Collection<CacheQueryTableColumnMetadata> valFields = tblMeta.getValueColumns();
+            Collection<CacheTypeFieldMetadata> valFields = typeMeta.getValueFields();
 
-            uniqValFields = F.view(valFields, new IgnitePredicate<CacheQueryTableColumnMetadata>() {
-                @Override public boolean apply(CacheQueryTableColumnMetadata col) {
+            uniqValFields = F.view(valFields, new IgnitePredicate<CacheTypeFieldMetadata>() {
+                @Override public boolean apply(CacheTypeFieldMetadata col) {
                     return !keyFields.contains(col);
                 }
             });
 
-            String schema = tblMeta.getSchema();
+            String schema = typeMeta.getDatabaseSchema();
 
-            String tblName = tblMeta.getTable();
+            String tblName = typeMeta.getDatabaseTable();
 
             keyCols = databaseColumns(keyFields);
 
@@ -1177,14 +1191,14 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
         }
 
         /**
-         * Extract database column names from {@link CacheQueryTableColumnMetadata}.
+         * Extract database column names from {@link CacheTypeFieldMetadata}.
          *
-         * @param dsc collection of {@link CacheQueryTableColumnMetadata}.
+         * @param dsc collection of {@link CacheTypeFieldMetadata}.
          */
-        private static Collection<String> databaseColumns(Collection<CacheQueryTableColumnMetadata> dsc) {
-            return F.transform(dsc, new C1<CacheQueryTableColumnMetadata, String>() {
+        private static Collection<String> databaseColumns(Collection<CacheTypeFieldMetadata> dsc) {
+            return F.transform(dsc, new C1<CacheTypeFieldMetadata, String>() {
                 /** {@inheritDoc} */
-                @Override public String apply(CacheQueryTableColumnMetadata col) {
+                @Override public String apply(CacheTypeFieldMetadata col) {
                     return col.getDbName();
                 }
             });
@@ -1204,7 +1218,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
             if (keyCnt == 1)
                 return loadQrySingle;
 
-            return dialect.loadQuery(tblMeta.getSchema(), tblMeta.getTable(), keyCols, cols, keyCnt);
+            return dialect.loadQuery(typeMeta.getDatabaseSchema(), typeMeta.getDatabaseTable(), keyCols, cols, keyCnt);
         }
         /**
          * Construct query for select values in range.
@@ -1214,7 +1228,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
          * @return Query with range.
          */
         protected String loadCacheRangeQuery(boolean appendLowerBound, boolean appendUpperBound) {
-            return dialect.loadCacheRangeQuery(tblMeta.getSchema(), tblMeta.getTable(), keyCols, cols,
+            return dialect.loadCacheRangeQuery(typeMeta.getDatabaseSchema(), typeMeta.getDatabaseTable(), keyCols, cols,
                 appendLowerBound, appendUpperBound);
         }
 
@@ -1225,7 +1239,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
 
         /** Value type. */
         protected String valueType() {
-            return typeMeta.getType();
+            return typeMeta.getValueType();
         }
 
         /**
@@ -1233,8 +1247,8 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
          *
          * @return Key columns.
          */
-        protected Collection<CacheQueryTableColumnMetadata> keyColumns() {
-            return tblMeta.getKeyColumns();
+        protected Collection<CacheTypeFieldMetadata> keyColumns() {
+            return typeMeta.getKeyFields();
         }
 
         /**
@@ -1242,8 +1256,8 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
          *
          * @return Value columns.
          */
-        protected Collection<CacheQueryTableColumnMetadata> valueColumns() {
-            return tblMeta.getValueColumns();
+        protected Collection<CacheTypeFieldMetadata> valueColumns() {
+            return typeMeta.getValueFields();
         }
     }
 
@@ -1308,6 +1322,31 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
     }
 
     /**
+     * Lazy initialization of value.
+     *
+     * @param <T> Cached object type
+     */
+    private abstract static class LazyValue<T> {
+        /** Cached value. */
+        private T val;
+
+        /**
+         * @return Construct value.
+         */
+        protected abstract T create();
+
+        /**
+         * @return Value.
+         */
+        public T value() {
+            if (val == null)
+                val = create();
+
+            return val;
+        }
+    }
+
+    /**
      * Worker for load by keys.
      *
      * @param <K1> Key type.
@@ -1344,7 +1383,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L
                 int i = 1;
 
                 for (Object key : keys)
-                    for (CacheQueryTableColumnMetadata field : m.keyColumns()) {
+                    for (CacheTypeFieldMetadata field : m.keyColumns()) {
                         Object fieldVal = extractField(m.keyType(), field.getJavaName(), key);
 
                         if (fieldVal != null)

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcPojoCacheStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcPojoCacheStore.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcPojoCacheStore.java
index e6d0f3a..93e71cc 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcPojoCacheStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcPojoCacheStore.java
@@ -17,7 +17,7 @@
 
 package org.apache.ignite.cache.store.jdbc;
 
-import org.apache.ignite.cache.query.*;
+import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.store.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.jetbrains.annotations.*;
@@ -56,7 +56,7 @@ public class JdbcPojoCacheStore extends JdbcCacheStore<Object, Object> {
          * @param clsName Class name.
          * @param fields Fields.
          */
-        public PojoMethodsCache(String clsName, Collection<CacheQueryTableColumnMetadata> fields) throws CacheException {
+        public PojoMethodsCache(String clsName, Collection<CacheTypeFieldMetadata> fields) throws CacheException {
             try {
                 cls = Class.forName(clsName);
 
@@ -76,7 +76,7 @@ public class JdbcPojoCacheStore extends JdbcCacheStore<Object, Object> {
 
             getters = U.newHashMap(fields.size());
 
-            for (CacheQueryTableColumnMetadata field : fields) {
+            for (CacheTypeFieldMetadata field : fields) {
                 String prop = capitalFirst(field.getJavaName());
 
                 try {
@@ -133,16 +133,16 @@ public class JdbcPojoCacheStore extends JdbcCacheStore<Object, Object> {
     protected volatile Map<String, Map<String, PojoMethodsCache>> mtdsCache = Collections.emptyMap();
 
     /** {@inheritDoc} */
-    @Override protected void prepareBuilders(@Nullable String cacheName, Collection<CacheQueryTypeMetadata> types)
+    @Override protected void prepareBuilders(@Nullable String cacheName, Collection<CacheTypeMetadata> types)
         throws CacheException {
         Map<String, PojoMethodsCache> typeMethods = U.newHashMap(types.size() * 2);
 
-        for (CacheQueryTypeMetadata type : types) {
-            CacheQueryTableMetadata tblMeta = type.getTableMetadata();
+        for (CacheTypeMetadata type : types) {
+            String keyType = type.getKeyType();
+            typeMethods.put(keyType, new PojoMethodsCache(keyType, type.getKeyFields()));
 
-            typeMethods.put(type.getKeyType(), new PojoMethodsCache(type.getKeyType(), tblMeta.getKeyColumns()));
-
-            typeMethods.put(type.getType(), new PojoMethodsCache(type.getType(), tblMeta.getValueColumns()));
+            String valType = type.getValueType();
+            typeMethods.put(valType, new PojoMethodsCache(valType, type.getValueFields()));
         }
 
         HashMap<String, Map<String, PojoMethodsCache>> newMtdsCache = new HashMap<>(mtdsCache);
@@ -153,14 +153,14 @@ public class JdbcPojoCacheStore extends JdbcCacheStore<Object, Object> {
     }
 
     /** {@inheritDoc} */
-    @Override protected <R> R buildObject(String typeName, Collection<CacheQueryTableColumnMetadata> fields,
+    @Override protected <R> R buildObject(String typeName, Collection<CacheTypeFieldMetadata> fields,
         ResultSet rs) throws CacheLoaderException {
         PojoMethodsCache t = mtdsCache.get(session().cacheName()).get(typeName);
 
         Object obj = t.newInstance();
 
         try {
-            for (CacheQueryTableColumnMetadata field : fields)
+            for (CacheTypeFieldMetadata field : fields)
                 t.setters.get(field.getJavaName()).invoke(obj, rs.getObject(field.getDbName()));
 
             return (R)obj;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/core/src/test/config/store/jdbc/Ignite.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/config/store/jdbc/Ignite.xml b/modules/core/src/test/config/store/jdbc/Ignite.xml
index 4bdd40a..de6e560 100644
--- a/modules/core/src/test/config/store/jdbc/Ignite.xml
+++ b/modules/core/src/test/config/store/jdbc/Ignite.xml
@@ -16,200 +16,86 @@
     limitations under the License.
 -->
 <!--
-    XML generated by Apache Ignite Schema Load utility: 02/33/2015
+    XML generated by Apache Ignite Schema Load utility: 02/03/2015
 -->
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans 
                            http://www.springframework.org/schema/beans/spring-beans.xsd">
-    <bean class="org.apache.ignite.cache.query.CacheQueryTypeMetadata">
-        <property name="type" value="org.apache.ignite.cache.store.jdbc.model.Organization"/>
+    <bean class="org.apache.ignite.cache.CacheTypeMetadata">
+        <property name="databaseSchema" value="PUBLIC"/>
+        <property name="databaseTable" value="ORGANIZATION"/>
         <property name="keyType" value="org.apache.ignite.cache.store.jdbc.model.OrganizationKey"/>
-        <property name="tableMetadata">
-            <bean class="org.apache.ignite.cache.query.CacheQueryTableMetadata">
-                <property name="schema" value="PUBLIC"/>
-                <property name="table" value="ORGANIZATION"/>
-                <property name="keyColumns">
-                    <list>
-                        <bean class="org.apache.ignite.cache.query.CacheQueryTableColumnMetadata">
-                            <property name="dbName" value="ID"/>
-                            <property name="dbType" value="4"/>
-                            <property name="javaName" value="id"/>
-                            <property name="javaType" value="java.lang.Integer"/>
-                        </bean>
-                    </list>
-                </property>
-                <property name="valueColumns">
-                    <list>
-                        <bean class="org.apache.ignite.cache.query.CacheQueryTableColumnMetadata">
-                            <property name="dbName" value="ID"/>
-                            <property name="dbType" value="4"/>
-                            <property name="javaName" value="id"/>
-                            <property name="javaType" value="java.lang.Integer"/>
-                        </bean>
-                        <bean class="org.apache.ignite.cache.query.CacheQueryTableColumnMetadata">
-                            <property name="dbName" value="NAME"/>
-                            <property name="dbType" value="12"/>
-                            <property name="javaName" value="name"/>
-                            <property name="javaType" value="java.lang.String"/>
-                        </bean>
-                        <bean class="org.apache.ignite.cache.query.CacheQueryTableColumnMetadata">
-                            <property name="dbName" value="CITY"/>
-                            <property name="dbType" value="12"/>
-                            <property name="javaName" value="city"/>
-                            <property name="javaType" value="java.lang.String"/>
-                        </bean>
-                    </list>
-                </property>
-            </bean>
+        <property name="valueType" value="org.apache.ignite.cache.store.jdbc.model.Organization"/>
+        <property name="keyFields">
+            <list>
+                <bean class="org.apache.ignite.cache.CacheTypeFieldMetadata">
+                    <property name="dbName" value="ID"/>
+                    <property name="dbType" value="4"/>
+                    <property name="javaName" value="id"/>
+                    <property name="javaType" value="java.lang.Integer"/>
+                </bean>
+            </list>
         </property>
-        <property name="queryFields">
-            <map>
-                <entry key="id" value="java.lang.Integer"/>
-                <entry key="name" value="java.lang.String"/>
-                <entry key="city" value="java.lang.String"/>
-            </map>
-        </property>
-        <property name="ascendingFields">
-            <map>
-                <entry key="id" value="java.lang.Integer"/>
-                <entry key="name" value="java.lang.String"/>
-                <entry key="city" value="java.lang.String"/>
-            </map>
-        </property>
-        <property name="groups">
-            <map>
-                <entry key="PRIMARY_KEY_D">
-                    <map>
-                        <entry key="id">
-                            <bean class="org.apache.ignite.lang.IgniteBiTuple">
-                                <constructor-arg value="java.lang.Integer"/>
-                                <constructor-arg value="false"/>
-                            </bean>
-                        </entry>
-                    </map>
-                </entry>
-                <entry key="ORG_NAME_CITY_IDX">
-                    <map>
-                        <entry key="name">
-                            <bean class="org.apache.ignite.lang.IgniteBiTuple">
-                                <constructor-arg value="java.lang.String"/>
-                                <constructor-arg value="false"/>
-                            </bean>
-                        </entry>
-                        <entry key="city">
-                            <bean class="org.apache.ignite.lang.IgniteBiTuple">
-                                <constructor-arg value="java.lang.String"/>
-                                <constructor-arg value="false"/>
-                            </bean>
-                        </entry>
-                    </map>
-                </entry>
-                <entry key="ORG_NAME_IDX">
-                    <map>
-                        <entry key="name">
-                            <bean class="org.apache.ignite.lang.IgniteBiTuple">
-                                <constructor-arg value="java.lang.String"/>
-                                <constructor-arg value="false"/>
-                            </bean>
-                        </entry>
-                    </map>
-                </entry>
-            </map>
+        <property name="valueFields">
+            <list>
+                <bean class="org.apache.ignite.cache.CacheTypeFieldMetadata">
+                    <property name="dbName" value="ID"/>
+                    <property name="dbType" value="4"/>
+                    <property name="javaName" value="id"/>
+                    <property name="javaType" value="java.lang.Integer"/>
+                </bean>
+                <bean class="org.apache.ignite.cache.CacheTypeFieldMetadata">
+                    <property name="dbName" value="NAME"/>
+                    <property name="dbType" value="12"/>
+                    <property name="javaName" value="name"/>
+                    <property name="javaType" value="java.lang.String"/>
+                </bean>
+                <bean class="org.apache.ignite.cache.CacheTypeFieldMetadata">
+                    <property name="dbName" value="CITY"/>
+                    <property name="dbType" value="12"/>
+                    <property name="javaName" value="city"/>
+                    <property name="javaType" value="java.lang.String"/>
+                </bean>
+            </list>
         </property>
     </bean>
-    <bean class="org.apache.ignite.cache.query.CacheQueryTypeMetadata">
-        <property name="type" value="org.apache.ignite.cache.store.jdbc.model.Person"/>
+    <bean class="org.apache.ignite.cache.CacheTypeMetadata">
+        <property name="databaseSchema" value="PUBLIC"/>
+        <property name="databaseTable" value="PERSON"/>
         <property name="keyType" value="org.apache.ignite.cache.store.jdbc.model.PersonKey"/>
-        <property name="tableMetadata">
-            <bean class="org.apache.ignite.cache.query.CacheQueryTableMetadata">
-                <property name="schema" value="PUBLIC"/>
-                <property name="table" value="PERSON"/>
-                <property name="keyColumns">
-                    <list>
-                        <bean class="org.apache.ignite.cache.query.CacheQueryTableColumnMetadata">
-                            <property name="dbName" value="ID"/>
-                            <property name="dbType" value="4"/>
-                            <property name="javaName" value="id"/>
-                            <property name="javaType" value="java.lang.Integer"/>
-                        </bean>
-                    </list>
-                </property>
-                <property name="valueColumns">
-                    <list>
-                        <bean class="org.apache.ignite.cache.query.CacheQueryTableColumnMetadata">
-                            <property name="dbName" value="ID"/>
-                            <property name="dbType" value="4"/>
-                            <property name="javaName" value="id"/>
-                            <property name="javaType" value="java.lang.Integer"/>
-                        </bean>
-                        <bean class="org.apache.ignite.cache.query.CacheQueryTableColumnMetadata">
-                            <property name="dbName" value="ORG_ID"/>
-                            <property name="dbType" value="4"/>
-                            <property name="javaName" value="orgId"/>
-                            <property name="javaType" value="java.lang.Integer"/>
-                        </bean>
-                        <bean class="org.apache.ignite.cache.query.CacheQueryTableColumnMetadata">
-                            <property name="dbName" value="NAME"/>
-                            <property name="dbType" value="12"/>
-                            <property name="javaName" value="name"/>
-                            <property name="javaType" value="java.lang.String"/>
-                        </bean>
-                    </list>
-                </property>
-            </bean>
-        </property>
-        <property name="queryFields">
-            <map>
-                <entry key="id" value="java.lang.Integer"/>
-                <entry key="orgId" value="java.lang.Integer"/>
-                <entry key="name" value="java.lang.String"/>
-            </map>
-        </property>
-        <property name="ascendingFields">
-            <map>
-                <entry key="id" value="java.lang.Integer"/>
-                <entry key="name" value="java.lang.String"/>
-            </map>
-        </property>
-        <property name="descendingFields">
-            <map>
-                <entry key="name" value="java.lang.String"/>
-            </map>
+        <property name="valueType" value="org.apache.ignite.cache.store.jdbc.model.Person"/>
+        <property name="keyFields">
+            <list>
+                <bean class="org.apache.ignite.cache.CacheTypeFieldMetadata">
+                    <property name="dbName" value="ID"/>
+                    <property name="dbType" value="4"/>
+                    <property name="javaName" value="id"/>
+                    <property name="javaType" value="java.lang.Integer"/>
+                </bean>
+            </list>
         </property>
-        <property name="groups">
-            <map>
-                <entry key="PRIMARY_KEY_8">
-                    <map>
-                        <entry key="id">
-                            <bean class="org.apache.ignite.lang.IgniteBiTuple">
-                                <constructor-arg value="java.lang.Integer"/>
-                                <constructor-arg value="false"/>
-                            </bean>
-                        </entry>
-                    </map>
-                </entry>
-                <entry key="PERSON_NAME_IDX1">
-                    <map>
-                        <entry key="name">
-                            <bean class="org.apache.ignite.lang.IgniteBiTuple">
-                                <constructor-arg value="java.lang.String"/>
-                                <constructor-arg value="false"/>
-                            </bean>
-                        </entry>
-                    </map>
-                </entry>
-                <entry key="PERSON_NAME_IDX2">
-                    <map>
-                        <entry key="name">
-                            <bean class="org.apache.ignite.lang.IgniteBiTuple">
-                                <constructor-arg value="java.lang.String"/>
-                                <constructor-arg value="true"/>
-                            </bean>
-                        </entry>
-                    </map>
-                </entry>
-            </map>
+        <property name="valueFields">
+            <list>
+                <bean class="org.apache.ignite.cache.CacheTypeFieldMetadata">
+                    <property name="dbName" value="ID"/>
+                    <property name="dbType" value="4"/>
+                    <property name="javaName" value="id"/>
+                    <property name="javaType" value="java.lang.Integer"/>
+                </bean>
+                <bean class="org.apache.ignite.cache.CacheTypeFieldMetadata">
+                    <property name="dbName" value="ORG_ID"/>
+                    <property name="dbType" value="4"/>
+                    <property name="javaName" value="orgId"/>
+                    <property name="javaType" value="java.lang.Integer"/>
+                </bean>
+                <bean class="org.apache.ignite.cache.CacheTypeFieldMetadata">
+                    <property name="dbName" value="NAME"/>
+                    <property name="dbType" value="12"/>
+                    <property name="javaName" value="name"/>
+                    <property name="javaType" value="java.lang.String"/>
+                </bean>
+            </list>
         </property>
     </bean>
 </beans>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/AbstractJdbcCacheStoreMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/AbstractJdbcCacheStoreMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/AbstractJdbcCacheStoreMultithreadedSelfTest.java
index d4ecf42..c263ceb 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/AbstractJdbcCacheStoreMultithreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/AbstractJdbcCacheStoreMultithreadedSelfTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.cache.store.jdbc;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.query.*;
 import org.apache.ignite.cache.store.jdbc.model.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.util.typedef.*;
@@ -137,13 +136,9 @@ public abstract class AbstractJdbcCacheStoreMultithreadedSelfTest<T extends Jdbc
 
             springCtx.refresh();
 
-            Collection<CacheQueryTypeMetadata> tp = springCtx.getBeansOfType(CacheQueryTypeMetadata.class).values();
+            Collection<CacheTypeMetadata> tp = springCtx.getBeansOfType(CacheTypeMetadata.class).values();
 
-            CacheQueryConfiguration cq = new CacheQueryConfiguration();
-
-            cq.setTypeMetadata(tp);
-
-            cc.setQueryConfiguration(cq);
+            cc.setTypeMetadata(tp);
         }
         catch (BeansException e) {
             if (X.hasCause(e, ClassNotFoundException.class))

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/PojoJdbcCacheStoreTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/PojoJdbcCacheStoreTest.java b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/PojoJdbcCacheStoreTest.java
index b8b751b..c12eff7 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/PojoJdbcCacheStoreTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/PojoJdbcCacheStoreTest.java
@@ -18,7 +18,7 @@
 package org.apache.ignite.cache.store.jdbc;
 
 import org.apache.ignite.*;
-import org.apache.ignite.cache.query.*;
+import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.store.*;
 import org.apache.ignite.cache.store.jdbc.dialect.*;
 import org.apache.ignite.cache.store.jdbc.model.*;
@@ -117,8 +117,7 @@ public class PojoJdbcCacheStoreTest extends GridCommonAbstractTest {
 
             springCtx.refresh();
 
-            Collection<CacheQueryTypeMetadata> typeMeta =
-                springCtx.getBeansOfType(CacheQueryTypeMetadata.class).values();
+            Collection<CacheTypeMetadata> typeMeta = springCtx.getBeansOfType(CacheTypeMetadata.class).values();
 
             Map<Integer, Map<Object, JdbcCacheStore.EntryMapping>> cacheMappings = new HashMap<>();
 
@@ -128,7 +127,7 @@ public class PojoJdbcCacheStoreTest extends GridCommonAbstractTest {
 
             Map<Object, JdbcCacheStore.EntryMapping> entryMappings = U.newHashMap(typeMeta.size());
 
-            for (CacheQueryTypeMetadata type : typeMeta)
+            for (CacheTypeMetadata type : typeMeta)
                 entryMappings.put(store.keyTypeId(type.getKeyType()), new JdbcCacheStore.EntryMapping(dialect, type));
 
             store.prepareBuilders(null, typeMeta);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/Organization.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/Organization.java b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/Organization.java
index 9b82247..a4ed093 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/Organization.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/Organization.java
@@ -22,7 +22,7 @@ import java.io.*;
 /**
  * Organization definition.
  *
- * Code generated by Apache Ignite Schema Load utility: 02/33/2015.
+ * Code generated by Apache Ignite Schema Load utility: 02/03/2015.
  */
 public class Organization implements Serializable {
     /** */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/OrganizationKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/OrganizationKey.java b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/OrganizationKey.java
index 658929f..27a838c 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/OrganizationKey.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/OrganizationKey.java
@@ -22,7 +22,7 @@ import java.io.*;
 /**
  * OrganizationKey definition.
  *
- * Code generated by Apache Ignite Schema Load utility: 02/33/2015.
+ * Code generated by Apache Ignite Schema Load utility: 02/03/2015.
  */
 public class OrganizationKey implements Serializable {
     /** */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/Person.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/Person.java b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/Person.java
index 3807606..32b8400 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/Person.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/Person.java
@@ -22,7 +22,7 @@ import java.io.*;
 /**
  * Person definition.
  *
- * Code generated by Apache Ignite Schema Load utility: 02/33/2015.
+ * Code generated by Apache Ignite Schema Load utility: 02/03/2015.
  */
 public class Person implements Serializable {
     /** */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/PersonKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/PersonKey.java b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/PersonKey.java
index 9416fb5..b13709e 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/PersonKey.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/PersonKey.java
@@ -22,7 +22,7 @@ import java.io.*;
 /**
  * PersonKey definition.
  *
- * Code generated by Apache Ignite Schema Load utility: 02/33/2015.
+ * Code generated by Apache Ignite Schema Load utility: 02/03/2015.
  */
 public class PersonKey implements Serializable {
     /** */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/schema-load/src/main/java/org/apache/ignite/schema/generator/PojoGenerator.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/main/java/org/apache/ignite/schema/generator/PojoGenerator.java b/modules/schema-load/src/main/java/org/apache/ignite/schema/generator/PojoGenerator.java
index ac46a71..7d12e2c 100644
--- a/modules/schema-load/src/main/java/org/apache/ignite/schema/generator/PojoGenerator.java
+++ b/modules/schema-load/src/main/java/org/apache/ignite/schema/generator/PojoGenerator.java
@@ -167,7 +167,7 @@ public class PojoGenerator {
         add0(src, "/**");
         add0(src, " * " + type + " definition.");
         add0(src, " *");
-        add0(src, " * Code generated by Apache Ignite Schema Load utility: " + new SimpleDateFormat("MM/DD/YYYY").format(new Date()) + ".");
+        add0(src, " * Code generated by Apache Ignite Schema Load utility: " + new SimpleDateFormat("MM/dd/yyyy").format(new Date()) + ".");
         add0(src, " */");
         add0(src, "public class " + type + " implements Serializable {");
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/schema-load/src/main/java/org/apache/ignite/schema/generator/XmlGenerator.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/main/java/org/apache/ignite/schema/generator/XmlGenerator.java b/modules/schema-load/src/main/java/org/apache/ignite/schema/generator/XmlGenerator.java
index f38d884..2fbef79 100644
--- a/modules/schema-load/src/main/java/org/apache/ignite/schema/generator/XmlGenerator.java
+++ b/modules/schema-load/src/main/java/org/apache/ignite/schema/generator/XmlGenerator.java
@@ -17,8 +17,7 @@
 
 package org.apache.ignite.schema.generator;
 
-import org.apache.ignite.cache.query.*;
-import org.apache.ignite.lang.*;
+import org.apache.ignite.cache.*;
 import org.apache.ignite.schema.model.*;
 import org.apache.ignite.schema.ui.*;
 import org.w3c.dom.*;
@@ -59,7 +58,7 @@ public class XmlGenerator {
             "    limitations under the License.\n"));
 
         doc.appendChild(doc.createComment("\n    XML generated by Apache Ignite Schema Load utility: " +
-            new SimpleDateFormat("MM/DD/YYYY").format(new Date()) + "\n"));
+            new SimpleDateFormat("MM/dd/yyyy").format(new Date()) + "\n"));
     }
 
     /**
@@ -142,25 +141,6 @@ public class XmlGenerator {
     }
 
     /**
-     * Add fields to xml document.
-     *
-     * @param doc XML document.
-     * @param parent Parent XML node.
-     * @param name Property name.
-     * @param fields Map with fields.
-     */
-    private static void addFields(Document doc, Node parent, String name, Collection<PojoField> fields) {
-        if (!fields.isEmpty()) {
-            Element prop = addProperty(doc, parent, name, null);
-
-            Element map = addElement(doc, prop, "map");
-
-            for (PojoField field : fields)
-                addElement(doc, map, "entry", "key", field.javaName(), "value", field.javaTypeName());
-        }
-    }
-
-    /**
      * Add type descriptors to XML document.
      *
      * @param doc XML document.
@@ -168,14 +148,14 @@ public class XmlGenerator {
      * @param name Property name.
      * @param fields Collection of POJO fields.
      */
-    private static void addTableCoumns(Document doc, Node parent, String name, Collection<PojoField> fields) {
+    private static void addFields(Document doc, Node parent, String name, Collection<PojoField> fields) {
         if (!fields.isEmpty()) {
             Element prop = addProperty(doc, parent, name, null);
 
             Element list = addElement(doc, prop, "list");
 
             for (PojoField field : fields) {
-                Element item = addBean(doc, list, CacheQueryTableColumnMetadata.class);
+                Element item = addBean(doc, list, CacheTypeFieldMetadata.class);
 
                 addProperty(doc, item, "dbName", field.dbName());
                 addProperty(doc, item, "dbType", String.valueOf(field.dbType()));
@@ -186,62 +166,6 @@ public class XmlGenerator {
     }
 
     /**
-     * Add table metadata to xml document.
-     *
-     * @param doc XML document.
-     * @param parent Parent XML node.
-     * @param pojo POJO descriptor.
-     */
-    private static void addTableMetadata(Document doc, Node parent, PojoDescriptor pojo, boolean includeKeys) {
-        Element tblMeta = addProperty(doc, parent, "tableMetadata", null);
-
-        Element bean = addBean(doc, tblMeta, CacheQueryTableMetadata.class);
-
-        addProperty(doc, bean, "schema", pojo.schema());
-
-        addProperty(doc, bean, "table", pojo.table());
-
-        addTableCoumns(doc, bean, "keyColumns", pojo.keyFields());
-
-        addTableCoumns(doc, bean, "valueColumns", pojo.valueFields(includeKeys));
-    }
-
-    /**
-     * Add indexes to xml document.
-     *
-     * @param doc XML document.
-     * @param parent Parent XML node.
-     * @param groups Map with indexes.
-     */
-    private static void addGroups(Document doc, Node parent,
-        Map<String, Map<String, IgniteBiTuple<String, Boolean>>> groups) {
-        if (!groups.isEmpty()) {
-            Element prop = addProperty(doc, parent, "groups", null);
-
-            Element map = addElement(doc, prop, "map");
-
-            for (Map.Entry<String, Map<String, IgniteBiTuple<String, Boolean>>> group : groups.entrySet()) {
-                Element entry1 = addElement(doc, map, "entry", "key", group.getKey());
-
-                Element val1 = addElement(doc, entry1, "map");
-
-                Map<String, IgniteBiTuple<String, Boolean>> fields = group.getValue();
-
-                for (Map.Entry<String, IgniteBiTuple<String, Boolean>> field : fields.entrySet()) {
-                    Element entry2 = addElement(doc, val1, "entry", "key", field.getKey());
-
-                    Element val2 = addBean(doc, entry2, IgniteBiTuple.class);
-
-                    IgniteBiTuple<String, Boolean> idx = field.getValue();
-
-                    addElement(doc, val2, "constructor-arg", null, null, "value", idx.get1());
-                    addElement(doc, val2, "constructor-arg", null, null, "value", String.valueOf(idx.get2()));
-                }
-            }
-        }
-    }
-
-    /**
      * Add element with type metadata to XML document.
      *
      * @param doc XML document.
@@ -251,21 +175,19 @@ public class XmlGenerator {
      */
     private static void addTypeMetadata(Document doc, Node parent, String pkg, PojoDescriptor pojo,
         boolean includeKeys) {
-        Element bean = addBean(doc, parent, CacheQueryTypeMetadata.class);
+        Element bean = addBean(doc, parent, CacheTypeMetadata.class);
 
-        addProperty(doc, bean, "type", pkg + "." + pojo.valueClassName());
+        addProperty(doc, bean, "databaseSchema", pojo.schema());
 
-        addProperty(doc, bean, "keyType", pkg + "." + pojo.keyClassName());
-
-        addTableMetadata(doc, bean, pojo, includeKeys);
+        addProperty(doc, bean, "databaseTable", pojo.table());
 
-        addFields(doc, bean, "queryFields", pojo.fields());
+        addProperty(doc, bean, "keyType", pkg + "." + pojo.keyClassName());
 
-        addFields(doc, bean, "ascendingFields", pojo.ascendingFields());
+        addProperty(doc, bean, "valueType", pkg + "." + pojo.valueClassName());
 
-        addFields(doc, bean, "descendingFields", pojo.descendingFields());
+        addFields(doc, bean, "keyFields", pojo.keyFields());
 
-        addGroups(doc, bean, pojo.groups());
+        addFields(doc, bean, "valueFields", pojo.valueFields(includeKeys));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/schema-load/src/main/java/org/apache/ignite/schema/model/PojoDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/main/java/org/apache/ignite/schema/model/PojoDescriptor.java b/modules/schema-load/src/main/java/org/apache/ignite/schema/model/PojoDescriptor.java
index 6b0f785..6bbed5e 100644
--- a/modules/schema-load/src/main/java/org/apache/ignite/schema/model/PojoDescriptor.java
+++ b/modules/schema-load/src/main/java/org/apache/ignite/schema/model/PojoDescriptor.java
@@ -20,7 +20,6 @@ package org.apache.ignite.schema.model;
 import javafx.beans.property.*;
 import javafx.beans.value.*;
 import javafx.collections.*;
-import org.apache.ignite.lang.*;
 import org.apache.ignite.schema.parser.*;
 
 import java.math.*;
@@ -65,9 +64,6 @@ public class PojoDescriptor {
     /** Java class fields. */
     private final ObservableList<PojoField> fields;
 
-    /** Fields map for quick access. */
-    private final Map<String, PojoField> fieldsMap;
-
     /**
      * Constructor of POJO descriptor.
      *
@@ -120,8 +116,6 @@ public class PojoDescriptor {
 
         List<PojoField> flds = new ArrayList<>(cols.size());
 
-        fieldsMap = new HashMap<>(cols.size());
-
         for (DbColumn col : cols) {
             PojoField fld = new PojoField(col.name(), col.type(),
                 toJavaFieldName(col.name()), toJavaType(col.type(), col.nullable()).getName(),
@@ -130,8 +124,6 @@ public class PojoDescriptor {
             fld.owner(this);
 
             flds.add(fld);
-
-            fieldsMap.put(col.name(), fld);
         }
 
         fields = FXCollections.observableList(flds);
@@ -304,36 +296,6 @@ public class PojoDescriptor {
     }
 
     /**
-     * @return Ascending fields.
-     */
-    public Collection<PojoField> ascendingFields() {
-        Collection<PojoField> res = new ArrayList<>();
-
-        Set<String> asc = tbl.ascendingColumns();
-
-        for (PojoField field : fields)
-            if (asc.contains(field.dbName()))
-                res.add(field);
-
-        return res;
-    }
-
-    /**
-     * @return Descending fields.
-     */
-    public Collection<PojoField> descendingFields() {
-        Collection<PojoField> res = new ArrayList<>();
-
-        Set<String> desc = tbl.descendingColumns();
-
-        for (PojoField field : fields)
-            if (desc.contains(field.dbName()))
-                res.add(field);
-
-        return res;
-    }
-
-    /**
      * @return Java class fields.
      */
     public ObservableList<PojoField> fields() {
@@ -437,31 +399,4 @@ public class PojoDescriptor {
                 return Object.class;
         }
     }
-
-    /**
-     * Gets indexes groups.
-     */
-    public Map<String, Map<String, IgniteBiTuple<String, Boolean>>> groups() {
-        Map<String, Map<String, Boolean>> idxs = tbl.indexes();
-
-        Map<String, Map<String, IgniteBiTuple<String, Boolean>>> groups = new LinkedHashMap<>(idxs.size());
-
-        for (Map.Entry<String, Map<String, Boolean>> idx : idxs.entrySet()) {
-            String idxName = idx.getKey();
-
-            Map<String, Boolean> idxCols = idx.getValue();
-
-            Map<String, IgniteBiTuple<String, Boolean>> grp = new LinkedHashMap<>();
-
-            groups.put(idxName, grp);
-
-            for (Map.Entry<String, Boolean> idxCol : idxCols.entrySet()) {
-                PojoField fld = fieldsMap.get(idxCol.getKey());
-
-                grp.put(fld.javaName(), new IgniteBiTuple<>(fld.javaTypeName(), idxCol.getValue()));
-            }
-        }
-
-        return groups;
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/DatabaseMetadataParser.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/DatabaseMetadataParser.java b/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/DatabaseMetadataParser.java
index 4f57b07..dfc3a75 100644
--- a/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/DatabaseMetadataParser.java
+++ b/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/DatabaseMetadataParser.java
@@ -28,47 +28,6 @@ import java.util.*;
  * Database metadata parser.
  */
 public class DatabaseMetadataParser {
-//        try (ResultSet idxs = dbMeta.getIndexInfo(catalog, schema, tbl, false, true)) {
-//            while (idxs.next()) {
-//                String idxName = idxs.getString(6);
-//
-//                String colName = idxs.getString(9);
-//
-//                if (idxName == null || colName == null)
-//                    continue;
-//
-//                String idx = toJavaFieldName(idxName);
-//
-//                String col = toJavaFieldName(colName);
-//
-//                String askOrDesc = idxs.getString(10);
-//
-//                LinkedHashMap<String, IgniteBiTuple<Class<?>, Boolean>> idxCols = groups.get(idx);
-//
-//                if (idxCols == null) {
-//                    idxCols = new LinkedHashMap<>();
-//
-//                    groups.put(idx, idxCols);
-//                }
-//
-//                Class<?> dataType = qryFields.get(col);
-//
-//                Boolean desc = askOrDesc != null ? "D".equals(askOrDesc) : null;
-//
-//                if (desc != null) {
-//                    if (desc)
-//                        descFields.put(col, dataType);
-//                    else
-//                        ascFields.put(col, dataType);
-//                }
-//
-//                idxCols.put(col, new IgniteBiTuple<Class<?>, Boolean>(dataType, desc));
-//            }
-//        }
-//
-//        return new PojoDescriptor(parent, typeMeta, fields);
-//    }
-
     /**
      * Parse database metadata.
      *
@@ -108,9 +67,7 @@ public class DatabaseMetadataParser {
             Collection<PojoDescriptor> children = childrens.get(schema);
 
             if (parent == null) {
-                parent = new PojoDescriptor(null, new DbTable(schema, "", Collections.<DbColumn>emptyList(),
-                    Collections.<String>emptySet(), Collections.<String>emptySet(),
-                    Collections.<String, Map<String, Boolean>>emptyMap()));
+                parent = new PojoDescriptor(null, new DbTable(schema, "", Collections.<DbColumn>emptyList()));
 
                 children = new ArrayList<>();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/DbTable.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/DbTable.java b/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/DbTable.java
index 35c7d91..91c69b6 100644
--- a/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/DbTable.java
+++ b/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/DbTable.java
@@ -32,33 +32,17 @@ public class DbTable {
     /** Columns. */
     private final Collection<DbColumn> cols;
 
-    /** Columns in ascending order. */
-    private final Set<String> ascCols;
-
-    /** Columns in descending order. */
-    private final Set<String> descCols;
-
-    /** Indexes. */
-    private final Map<String, Map<String, Boolean>> idxs;
-
     /**
      * Default columns.
      *
      * @param schema Schema name.
      * @param tbl Table name.
      * @param cols Columns.
-     * @param ascCols Columns in ascending order.
-     * @param descCols Columns in descending order.
-     * @param idxs Indexes;
      */
-    public DbTable(String schema, String tbl, Collection<DbColumn> cols, Set<String> ascCols, Set<String> descCols,
-        Map<String, Map<String, Boolean>> idxs) {
+    public DbTable(String schema, String tbl, Collection<DbColumn> cols) {
         this.schema = schema;
         this.tbl = tbl;
         this.cols = cols;
-        this.ascCols = ascCols;
-        this.descCols = descCols;
-        this.idxs = idxs;
     }
 
     /**
@@ -81,25 +65,4 @@ public class DbTable {
     public Collection<DbColumn> columns() {
         return cols;
     }
-
-    /**
-     * @return Fields in ascending order
-     */
-    public Set<String> ascendingColumns() {
-        return ascCols;
-    }
-
-    /**
-     * @return Fields in descending order
-     */
-    public Set<String> descendingColumns() {
-        return descCols;
-    }
-
-    /**
-     * @return Indexes.
-     */
-    public Map<String, Map<String, Boolean>> indexes() {
-        return idxs;
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed2af98c/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/dialect/JdbcMetadataDialect.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/dialect/JdbcMetadataDialect.java b/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/dialect/JdbcMetadataDialect.java
index c9cf0cf..51b1568 100644
--- a/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/dialect/JdbcMetadataDialect.java
+++ b/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/dialect/JdbcMetadataDialect.java
@@ -98,45 +98,7 @@ public class JdbcMetadataDialect extends DatabaseMetadataDialect {
                             }
                         }
 
-                        Set<String> ascCols = new HashSet<>();
-
-                        Set<String> descCols = new HashSet<>();
-
-                        Map<String, Map<String, Boolean>> idxs = new LinkedHashMap<>();
-
-                        try (ResultSet idxRs = dbMeta.getIndexInfo(catalog, schema, tblName, false, true)) {
-                            while (idxRs.next()) {
-                                String idxName = idxRs.getString("INDEX_NAME");
-
-                                String colName = idxRs.getString("COLUMN_NAME");
-
-                                if (idxName == null || colName == null)
-                                    continue;
-
-                                Map<String, Boolean> idx = idxs.get(idxName);
-
-                                if (idx == null) {
-                                    idx = new LinkedHashMap<>();
-
-                                    idxs.put(idxName, idx);
-                                }
-
-                                String askOrDesc = idxRs.getString("ASC_OR_DESC");
-
-                                Boolean desc = askOrDesc != null ? "D".equals(askOrDesc) : null;
-
-                                idx.put(colName, desc);
-
-                                if (desc != null) {
-                                    if (desc)
-                                        descCols.add(colName);
-                                    else
-                                        ascCols.add(colName);
-                                }
-                            }
-                        }
-
-                        tbls.add(new DbTable(schema, tblName, cols, ascCols, descCols, idxs));
+                        tbls.add(new DbTable(schema, tblName, cols));
                     }
                 }
             }


Mime
View raw message