diff options
author | Vitaly Takmazov | 2016-07-12 20:52:50 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-07-12 20:52:50 +0300 |
commit | 34699029c1a42e7a8ea30df57370401801a64eae (patch) | |
tree | e9b79b35df25cdcb85a1f577d5e8f003ffd8971c /juick-core | |
parent | f04b1c21e42525377d01b5d102006ae4efe5d4b1 (diff) |
api: fix unames and jids queries
Diffstat (limited to 'juick-core')
-rw-r--r-- | juick-core/src/main/java/com/juick/server/UserQueries.java | 4 |
1 files 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<User> getUsersByName(JdbcTemplate sql, List<String> 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)); |