Fix retrieving log from SQLBacking

This commit is contained in:
Luck 2017-01-08 20:12:33 +00:00
parent 960c2291b6
commit 7042c45deb
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -221,17 +221,19 @@ public class SQLBacking extends AbstractBacking {
try (Connection c = provider.getConnection()) {
try (PreparedStatement ps = c.prepareStatement(prefix.apply(ACTION_SELECT_ALL))) {
try (ResultSet rs = ps.executeQuery()) {
final String actedUuid = rs.getString("acted_uuid");
LogEntry e = new LogEntry(
rs.getLong("time"),
UUID.fromString(rs.getString("actor_uuid")),
rs.getString("actor_name"),
rs.getString("type").toCharArray()[0],
actedUuid.equals("null") ? null : UUID.fromString(actedUuid),
rs.getString("acted_name"),
rs.getString("action")
);
log.add(e);
while (rs.next()) {
final String actedUuid = rs.getString("acted_uuid");
LogEntry e = new LogEntry(
rs.getLong("time"),
UUID.fromString(rs.getString("actor_uuid")),
rs.getString("actor_name"),
rs.getString("type").toCharArray()[0],
actedUuid.equals("null") ? null : UUID.fromString(actedUuid),
rs.getString("acted_name"),
rs.getString("action")
);
log.add(e);
}
}
}
} catch (SQLException e) {