usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mru...@apache.org
Subject [15/50] [abbrv] usergrid git commit: Let the java SDK handle null ql values passed in and update UG stack to better work with new Java SDK interfaces.
Date Wed, 17 Aug 2016 21:17:34 GMT
Let the java SDK handle null ql values passed in and update UG stack to better work with new
Java SDK interfaces.


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

Branch: refs/heads/datastax-cass-driver
Commit: 1e11464c7e755035e40cda8f83a042fa08ef7892
Parents: 055289a
Author: Michael Russo <mrusso@apigee.com>
Authored: Thu Jul 28 09:58:48 2016 -0700
Committer: Michael Russo <mrusso@apigee.com>
Committed: Thu Jul 28 09:58:48 2016 -0700

----------------------------------------------------------------------
 .../usergrid/java/client/query/UsergridQuery.java |  6 ++++--
 .../usergrid/query/validator/ApiServerRunner.java | 18 +++---------------
 2 files changed, 7 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/1e11464c/sdks/java/src/main/java/org/apache/usergrid/java/client/query/UsergridQuery.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/query/UsergridQuery.java
b/sdks/java/src/main/java/org/apache/usergrid/java/client/query/UsergridQuery.java
index f7c8430..e8c78c2 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/query/UsergridQuery.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/query/UsergridQuery.java
@@ -261,8 +261,10 @@ public final class UsergridQuery {
     }
 
     @NotNull
-    public UsergridQuery ql(@NotNull final String value) {
-        return this.addRequirement(value);
+    public UsergridQuery ql(final String value) {
+
+        return value != null && !value.isEmpty() ? this.addRequirement(value) : this;
+
     }
 
     @NotNull

http://git-wip-us.apache.org/repos/asf/usergrid/blob/1e11464c/stack/query-validator/src/main/java/org/apache/usergrid/query/validator/ApiServerRunner.java
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/main/java/org/apache/usergrid/query/validator/ApiServerRunner.java
b/stack/query-validator/src/main/java/org/apache/usergrid/query/validator/ApiServerRunner.java
index ba62f55..922cd02 100644
--- a/stack/query-validator/src/main/java/org/apache/usergrid/query/validator/ApiServerRunner.java
+++ b/stack/query-validator/src/main/java/org/apache/usergrid/query/validator/ApiServerRunner.java
@@ -16,8 +16,6 @@
  */
 package org.apache.usergrid.query.validator;
 
-import com.fasterxml.jackson.databind.JsonNode;
-
 import java.util.*;
 import java.util.logging.Logger;
 import org.apache.usergrid.java.client.UsergridClient;
@@ -104,20 +102,10 @@ public class ApiServerRunner implements QueryRunner {
             Entity entity = new QueryEntity();
             entity.setUuid(UUID.fromString(clientEntity.getUuid()));
             entity.setType(clientEntity.getType());
-            Map<String, JsonNode> values = clientEntity.getProperties();
+            Map<String, ?> values = clientEntity.toMapValue();
             for( String key : values.keySet() ) {
-                JsonNode node = values.get(key);
-                if( node.isBoolean() ) {
-                    entity.setProperty(key, node.asBoolean());
-                } else if( node.isInt() ) {
-                    entity.setProperty(key, node.asInt());
-                } else if( node.isLong() ) {
-                    entity.setProperty(key, node.asLong());
-                } else if( node.isDouble() ) {
-                    entity.setProperty(key, node.asDouble());
-                } else {
-                    entity.setProperty(key, node.asText());
-                }
+                Object node = values.get(key);
+                entity.setProperty(key, node);
             }
             entities.add(entity);
         }


Mime
View raw message