diff options
Diffstat (limited to 'src/database/QueryUtils.java')
-rw-r--r-- | src/database/QueryUtils.java | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/src/database/QueryUtils.java b/src/database/QueryUtils.java index 66edd1c..c6b8304 100644 --- a/src/database/QueryUtils.java +++ b/src/database/QueryUtils.java @@ -26,8 +26,10 @@ public class QueryUtils { public final static String insertHash = buildQuery("hashtag", null, "tweetid", "hashtag"); - // TODO: split url to userUrl and tweetUrl - public final static String insertUrl + public final static String insertUserUrl + = buildQuery("url", null, "userid", "url"); + + public final static String insertTweetUrl = buildQuery("url", null, "tweetid", "url"); public final static String insertMentions @@ -65,7 +67,7 @@ public class QueryUtils { primaryKeys = keys; } for (String pkey : primaryKeys) { - pkey_matches = sep + "u." + pkey + " = nv." + pkey; + pkey_matches += sep + "u." + pkey + " = nv." + pkey; sep = " AND "; } @@ -135,22 +137,4 @@ public class QueryUtils { brandStmt.setString("brand", brand); // TODO: rating (positive) } - - public static void setInsertHashParams(NamedPreparedStatement hashStmt, - long id, String text) throws SQLException { - hashStmt.setLong("tweetid", id); - hashStmt.setString("hashtag", text); - } - - public static void setInsertUrlParams(NamedPreparedStatement urlStmt, - long id, String text) throws SQLException { - urlStmt.setLong("tweetid", id); - urlStmt.setString("url", text); - } - - public static void setInsertMentionsParams(NamedPreparedStatement mentStmt, - long id, long userid) throws SQLException { - mentStmt.setLong("tweetid", id); - mentStmt.setLong("userid", userid); - } } |