ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [3/3] incubator-ignite git commit: # ignite-32 WIP: Added key to type descriptor.
Date Wed, 24 Dec 2014 06:24:03 GMT
# ignite-32 WIP: Added key to type descriptor.


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

Branch: refs/heads/ignite-32
Commit: 5eb96c399d538a8d39b22cda1189562754e1c9d2
Parents: ec6186f
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Wed Dec 24 13:23:57 2014 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Wed Dec 24 13:23:57 2014 +0700

----------------------------------------------------------------------
 .../grid/cache/query/GridCacheQueryTypeMetadata.java    | 12 ++++++++++++
 .../org/apache/ignite/schema/db/DbMetadataParser.java   |  4 ++++
 .../org/apache/ignite/schema/xml/XmlTransformer.java    |  2 ++
 3 files changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5eb96c39/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQueryTypeMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQueryTypeMetadata.java
b/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQueryTypeMetadata.java
index 9223f43..f8e8374 100644
--- a/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQueryTypeMetadata.java
+++ b/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQueryTypeMetadata.java
@@ -32,6 +32,9 @@ public class GridCacheQueryTypeMetadata {
     @GridToStringInclude
     private Map<String, Class<?>> qryFlds;
 
+    /** Key name. */
+    private String key;
+
     /** Type descriptors. */
     @GridToStringInclude
     private Map<String, GridCacheQueryTypeDescriptor> typeDescs;
@@ -71,6 +74,7 @@ public class GridCacheQueryTypeMetadata {
         type = src.getType();
         schema = src.getSchema();
         tbl = src.getTableName();
+        key = src.getKey();
 
         qryFlds = new LinkedHashMap<>(src.getQueryFields());
         typeDescs = new LinkedHashMap<>(src.getTypeDescriptors());
@@ -144,6 +148,14 @@ public class GridCacheQueryTypeMetadata {
         this.tbl = tbl;
     }
 
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
     /**
      * Gets database type descriptors.
      *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5eb96c39/modules/schema-load/src/main/java/org/apache/ignite/schema/db/DbMetadataParser.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/main/java/org/apache/ignite/schema/db/DbMetadataParser.java
b/modules/schema-load/src/main/java/org/apache/ignite/schema/db/DbMetadataParser.java
index 0368140..1d95176 100644
--- a/modules/schema-load/src/main/java/org/apache/ignite/schema/db/DbMetadataParser.java
+++ b/modules/schema-load/src/main/java/org/apache/ignite/schema/db/DbMetadataParser.java
@@ -155,6 +155,10 @@ public class DbMetadataParser {
             String col = toJavaFieldName(dbName);
             Class<?> type = dataType(jdbcType);
 
+            // TODO: IGNITE-32 Get real key.
+            if (res.getKey() == null)
+                res.setKey(col);
+
             qryFields.put(col, type);
             typeDescs.put(col, new GridCacheQueryTypeDescriptor(dbName, jdbcType, type));
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5eb96c39/modules/schema-load/src/main/java/org/apache/ignite/schema/xml/XmlTransformer.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/main/java/org/apache/ignite/schema/xml/XmlTransformer.java
b/modules/schema-load/src/main/java/org/apache/ignite/schema/xml/XmlTransformer.java
index 08655d3..4075c7b 100644
--- a/modules/schema-load/src/main/java/org/apache/ignite/schema/xml/XmlTransformer.java
+++ b/modules/schema-load/src/main/java/org/apache/ignite/schema/xml/XmlTransformer.java
@@ -246,6 +246,8 @@ public class XmlTransformer {
 
         addProperty(bean, "tableName", meta.getTableName());
 
+        addProperty(bean, "key", meta.getKey());
+
         addFields(bean, "queryFields", meta.getQueryFields());
 
         addTypeDescriptors(bean, meta.getTypeDescriptors());


Mime
View raw message