aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/UserQueries.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-01-15 22:56:33 +0300
committerGravatar Vitaly Takmazov2016-01-15 22:56:33 +0300
commit09fd6b8ee40802eceff9746d3c23aa8446ccbd64 (patch)
tree731b42333ab3bb29aed804988a7be597dcc45db2 /src/main/java/com/juick/server/UserQueries.java
parentf14eea2cfc80dac5e9b304a57457e7f82842a8ed (diff)
update core
Diffstat (limited to 'src/main/java/com/juick/server/UserQueries.java')
-rw-r--r--src/main/java/com/juick/server/UserQueries.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/main/java/com/juick/server/UserQueries.java b/src/main/java/com/juick/server/UserQueries.java
index 27ae2870..2cd557c6 100644
--- a/src/main/java/com/juick/server/UserQueries.java
+++ b/src/main/java/com/juick/server/UserQueries.java
@@ -46,8 +46,8 @@ public class UserQueries {
@Override
public User mapRow(ResultSet rs, int rowNum) throws SQLException {
User user = new User();
- user.UID = rs.getInt("id");
- user.UName = rs.getString("nick");
+ user.setUID(rs.getInt("id"));
+ user.setUName(rs.getString("nick"));
user.Banned = rs.getBoolean("banned");
return user;
}
@@ -120,13 +120,13 @@ public class UserQueries {
if (i > 0) {
uids += ",";
}
- uids += users.get(i).UID;
+ uids += users.get(i).getUID();
}
sql.query("SELECT id,nick,banned FROM users WHERE id IN (" + uids + ")",
(rs, num) -> {
User u = users.get(num);
- u.UName = rs.getString(2);
+ u.setUName(rs.getString(2));
return u;
});
@@ -139,9 +139,9 @@ public class UserQueries {
+ "WHERE jids.jid IN (" + Utils.convertArrayString2String(jids) + ")",
(rs, rowNum) -> {
com.juick.User user = new com.juick.User();
- user.UID = rs.getInt(1);
- user.UName = rs.getString(2);
- user.JID = rs.getString(3);
+ user.setUID(rs.getInt(1));
+ user.setUName(rs.getString(2));
+ user.setJID(rs.getString(3));
return user;
});
}
@@ -166,7 +166,7 @@ public class UserQueries {
User user = sql.queryForObject("SELECT logins.user_id,users.nick, users.banned FROM logins " +
"INNER JOIN users ON logins.user_id=users.id WHERE logins.hash=?",
new UserMapper(), hash);
- user.AuthHash = hash;
+ user.setAuthHash(hash);
return user;
}
@@ -385,8 +385,8 @@ public class UserQueries {
rs.beforeFirst();
while (rs.next()) {
com.juick.User u = new com.juick.User();
- u.UID = rs.getInt(1);
- u.UName = rs.getString(2);
+ u.setUID(rs.getInt(1));
+ u.setUName(rs.getString(2));
users.add(u);
}
} catch (SQLException e) {
@@ -414,8 +414,8 @@ public class UserQueries {
rs.beforeFirst();
while (rs.next()) {
com.juick.User u = new com.juick.User();
- u.UID = rs.getInt(1);
- u.UName = rs.getString(2);
+ u.setUID(rs.getInt(1));
+ u.setUName(rs.getString(2));
users.add(u);
}
} catch (SQLException e) {
@@ -434,7 +434,7 @@ public class UserQueries {
sql.prepareStatement("INSERT INTO twitter(user_id,access_token,access_token_secret,uname) " +
"VALUES (?,?,?,?)" +
" ON DUPLICATE KEY UPDATE access_token=?,access_token_secret=?,uname=?");
- stmt.setInt(1, user.UID);
+ stmt.setInt(1, user.getUID());
stmt.setString(2, accessToken);
stmt.setString(3, accessTokenSecret);
stmt.setString(4, screenName);
@@ -445,7 +445,7 @@ public class UserQueries {
PreparedStatement stmt2 =
sql.prepareStatement("INSERT INTO subscr_users(user_id,suser_id,jid) " +
"VALUES (?,1741,'juick\\@twitter.juick.com')");
- stmt2.setInt(1, user.UID);
+ stmt2.setInt(1, user.getUID());
return stmt2.execute();
}
} catch (SQLException e) {
@@ -483,7 +483,7 @@ public class UserQueries {
"UPDATE jids SET active=? WHERE user_id=? AND jid=?");
int newStatus = jidStatus == ActiveStatus.Active ? 1 : 0;
preparedStatement.setInt(1, newStatus);
- preparedStatement.setInt(2, user.UID);
+ preparedStatement.setInt(2, user.getUID());
preparedStatement.setString(3, JID);
return preparedStatement;