From 34699029c1a42e7a8ea30df57370401801a64eae Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 12 Jul 2016 20:52:50 +0300 Subject: api: fix unames and jids queries --- juick-core/src/main/java/com/juick/server/UserQueries.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/juick-core/src/main/java/com/juick/server/UserQueries.java b/juick-core/src/main/java/com/juick/server/UserQueries.java index 97d40968..b79f179c 100644 --- a/juick-core/src/main/java/com/juick/server/UserQueries.java +++ b/juick-core/src/main/java/com/juick/server/UserQueries.java @@ -126,7 +126,7 @@ public class UserQueries { public static List getUsersByName(JdbcTemplate sql, List unames) { if (!unames.isEmpty()) { - return sql.query("SELECT id,nick,banned FROM users WHERE nick IN (" + StringUtils.arrayToCommaDelimitedString(unames.toArray()) + ")", + return sql.query("SELECT id,nick,banned FROM users WHERE nick IN (\"" + StringUtils.arrayToDelimitedString(unames.toArray(), "\",\"") + "\")", new UserMapper()); } return Collections.emptyList(); @@ -144,7 +144,7 @@ public class UserQueries { if (!jids.isEmpty()) { return sql.query("SELECT users.id,users.nick,jids.jid FROM users " + "INNER JOIN jids ON jids.user_id=users.id " - + "WHERE jids.jid IN (" + StringUtils.arrayToCommaDelimitedString(jids.toArray()) + ")", + + "WHERE jids.jid IN (\"" + StringUtils.arrayToDelimitedString(jids.toArray(), "\",\"") + "\")", (rs, rowNum) -> { com.juick.User user = new com.juick.User(); user.setUID(rs.getInt(1)); -- cgit v1.2.3