summaryrefslogtreecommitdiff
path: root/src/database/QueryUtils.java
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-05-09 23:03:09 +0200
committerPeter Wu <peter@lekensteyn.nl>2014-05-09 23:03:09 +0200
commit34c600891613280e41cfd1ec1ad1bee8f23d043a (patch)
tree5d08b0673ff939d5bb066b4ac488c7623a86b1cf /src/database/QueryUtils.java
parent9be617801a8dabe4bcae017c2f671c5c10b3aebb (diff)
downloadDatafiller-34c600891613280e41cfd1ec1ad1bee8f23d043a.tar.gz
Entities can be missing, user.place is not a string
* User: place is not a string but a Place object. * User: entities is nullable. * Tweet: in_reply_to_user_id, coordinates is nullable. * ValidatingJsonDeserializer: Treat null values as missing fields. * ValidatingJsonDeserializerTest: Test for null values.
Diffstat (limited to 'src/database/QueryUtils.java')
-rw-r--r--src/database/QueryUtils.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/database/QueryUtils.java b/src/database/QueryUtils.java
index f87ba47..228ccc8 100644
--- a/src/database/QueryUtils.java
+++ b/src/database/QueryUtils.java
@@ -103,7 +103,11 @@ public class QueryUtils {
}
tweetStatement.setLong("replyid", tweet.in_reply_to_user_id);
// TODO: place is not a string...
- tweetStatement.setString("place", tweet.place);
+ if (tweet.place != null) {
+ tweetStatement.setString("place", tweet.place.full_name + " " + tweet.place.country);
+ } else {
+ tweetStatement.setString("place", null);
+ }
User twuser = tweet.user;
tweetStatement.setLong("userid", twuser.id);