summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-05-20 10:49:38 +0200
committerPeter Wu <peter@lekensteyn.nl>2014-05-20 10:49:38 +0200
commit915b5289b02db9c4809b009f4b8d9196c8436104 (patch)
tree91f72d4bb13e04d6fa70e8028d4ccb132aa57dad
parent276adf93ffeb4e71a6fd06a181c2ec629a50007e (diff)
downloadDatafiller-915b5289b02db9c4809b009f4b8d9196c8436104.tar.gz
Reply user ID can be NULL
-rw-r--r--src/data/Tweet.java2
-rw-r--r--src/database/QueryUtils.java6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/data/Tweet.java b/src/data/Tweet.java
index 91bb3d1..2e1a1f1 100644
--- a/src/data/Tweet.java
+++ b/src/data/Tweet.java
@@ -11,7 +11,7 @@ public class Tweet {
@ValidatingJsonDeserializer.Nullable
public String lang;
@ValidatingJsonDeserializer.Nullable
- public long in_reply_to_user_id;
+ public Long in_reply_to_user_id;
public DateTime created_at;
public int favorite_count;
@ValidatingJsonDeserializer.Nullable
diff --git a/src/database/QueryUtils.java b/src/database/QueryUtils.java
index a37b806..dac3ffc 100644
--- a/src/database/QueryUtils.java
+++ b/src/database/QueryUtils.java
@@ -113,7 +113,11 @@ public class QueryUtils {
} else {
tweetStatement.setLong("retweetid", null);
}
- tweetStatement.setLong("replyid", tweet.in_reply_to_user_id);
+ if (tweet.in_reply_to_user_id != null) {
+ tweetStatement.setLong("replyid", tweet.in_reply_to_user_id);
+ } else {
+ tweetStatement.setLong("replyid", null);
+ }
// TODO: place is not a string...
if (tweet.place != null) {
tweetStatement.setString("place", tweet.place.full_name + " " + tweet.place.country);