use of com.djrapitops.plan.storage.database.transactions.ExecStatement in project Plan by plan-player-analytics.
the class KickStoreTransaction method performOperations.
@Override
protected void performOperations() {
String sql = "UPDATE " + UsersTable.TABLE_NAME + " SET " + UsersTable.TIMES_KICKED + "=" + UsersTable.TIMES_KICKED + "+ 1" + WHERE + UsersTable.USER_UUID + "=?";
execute(new ExecStatement(sql) {
@Override
public void prepare(PreparedStatement statement) throws SQLException {
statement.setString(1, playerUUID.toString());
}
});
}
use of com.djrapitops.plan.storage.database.transactions.ExecStatement in project Plan by plan-player-analytics.
the class ServerIsProxyPatch method applyPatch.
@Override
protected void applyPatch() {
addColumn(ServerTable.TABLE_NAME, ServerTable.PROXY + ' ' + Sql.BOOL + " DEFAULT 0");
String populateFieldSql = "UPDATE " + ServerTable.TABLE_NAME + " SET " + ServerTable.PROXY + "=?" + WHERE + ServerTable.NAME + "=?";
execute(new ExecStatement(populateFieldSql) {
@Override
public void prepare(PreparedStatement statement) throws SQLException {
statement.setBoolean(1, true);
statement.setString(2, "BungeeCord");
}
});
}
use of com.djrapitops.plan.storage.database.transactions.ExecStatement in project Plan by plan-player-analytics.
the class UserInfoHostnameAllowNullPatch method applyPatch.
@Override
protected void applyPatch() {
tempOldTable();
execute(UserInfoTable.createTableSQL(dbType));
execute(new ExecStatement("INSERT INTO " + TABLE_NAME + " (" + UserInfoTable.ID + ',' + UserInfoTable.USER_ID + ',' + UserInfoTable.SERVER_ID + ',' + UserInfoTable.REGISTERED + ',' + UserInfoTable.OP + ',' + UserInfoTable.BANNED + ',' + UserInfoTable.JOIN_ADDRESS + ") SELECT " + UserInfoTable.ID + ',' + UserInfoTable.USER_ID + ',' + UserInfoTable.SERVER_ID + ',' + UserInfoTable.REGISTERED + ',' + UserInfoTable.OP + ',' + UserInfoTable.BANNED + ',' + "?" + FROM + TEMP_TABLE_NAME) {
@Override
public void prepare(PreparedStatement statement) throws SQLException {
statement.setNull(1, Types.VARCHAR);
}
});
dropTable(TEMP_TABLE_NAME);
}
use of com.djrapitops.plan.storage.database.transactions.ExecStatement in project Plan by plan-player-analytics.
the class BadNukkitRegisterValuePatch method multiplyInTable.
private void multiplyInTable(String tableName, String registered) {
String sql = "UPDATE " + tableName + " SET " + registered + "=" + registered + "*1000" + WHERE + registered + "<?" + AND + registered + ">?";
execute(new ExecStatement(sql) {
@Override
public void prepare(PreparedStatement statement) throws SQLException {
statement.setLong(1, System.currentTimeMillis() / 1000L);
statement.setLong(2, 0L);
}
});
}
use of com.djrapitops.plan.storage.database.transactions.ExecStatement in project Plan by plan-player-analytics.
the class StorePlayerTableResultTransaction method deleteOldRows.
private void deleteOldRows(Integer tableID, int afterRow) {
String sql = DELETE_FROM + TABLE_NAME + WHERE + TABLE_ID + "=?" + AND + USER_UUID + "=?" + AND + TABLE_ROW + // Since row count is zero indexed and afterRow is size the value should be removed.
">=?";
execute(new ExecStatement(sql) {
@Override
public void prepare(PreparedStatement statement) throws SQLException {
statement.setInt(1, tableID);
statement.setString(2, playerUUID.toString());
statement.setInt(3, afterRow);
}
});
}
Aggregations