diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-05-10 19:42:56 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-05-10 19:42:56 +0200 |
commit | 2b673df3123e3e1fd4edd6861abe316336e1d69c (patch) | |
tree | 1b26252b839c7ff5bb3f0f6c91affb4c0cdb7b6a /src/database/QueryUtils.java | |
parent | 49662b1b866e4d722cc3a046fc9834796cbd953b (diff) | |
download | Datafiller-2b673df3123e3e1fd4edd6861abe316336e1d69c.tar.gz |
Convert long to int where possible, fix retweetid
If there is no retweet, the retweetid must really be NULL, not 0. In
order to better match the database, convert some types to integers too.
Diffstat (limited to 'src/database/QueryUtils.java')
-rw-r--r-- | src/database/QueryUtils.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/database/QueryUtils.java b/src/database/QueryUtils.java index c307b40..4f87428 100644 --- a/src/database/QueryUtils.java +++ b/src/database/QueryUtils.java @@ -96,7 +96,7 @@ public class QueryUtils { Tweet tweet) throws SQLException { tweetStatement.setLong("tweetid", tweet.id); tweetStatement.setTimestamp("createdat", tweet.created_at); - tweetStatement.setLong("favcount", tweet.favorite_count); + tweetStatement.setInt("favcount", tweet.favorite_count); tweetStatement.setLong("retweetcount", tweet.retweet_count); tweetStatement.setString("text", tweet.text); if (tweet.coordinates != null) { @@ -110,7 +110,7 @@ public class QueryUtils { if (tweet.retweeted_status != null) { tweetStatement.setLong("retweetid", tweet.retweeted_status.id); } else { - tweetStatement.setLong("retweetid", 0); + tweetStatement.setLong("retweetid", null); } tweetStatement.setLong("replyid", tweet.in_reply_to_user_id); // TODO: place is not a string... @@ -125,9 +125,9 @@ public class QueryUtils { profileStatement.setLong("userid", twuser.id); profileStatement.setString("displayname", twuser.name); profileStatement.setString("timezone", twuser.time_zone); - profileStatement.setLong("tweetcount", twuser.statuses_count); - profileStatement.setLong("followercount", twuser.followers_count); - profileStatement.setLong("followedcount", twuser.friends_count); + profileStatement.setInt("tweetcount", twuser.statuses_count); + profileStatement.setInt("followercount", twuser.followers_count); + profileStatement.setInt("followedcount", twuser.friends_count); profileStatement.setString("location", twuser.location); profileStatement.setString("tweetname", twuser.screen_name); profileStatement.setTimestamp("createdat", twuser.created_at); |