@Override public Future<Unit> removeAll(int playerId) { return worker.cast( () -> { try (Connection co = dataSource.getConnection()) { try (PreparedStatement s = co.prepareStatement("delete from player_notifs where player_id=?")) { s.setInt(1, playerId); s.executeUpdate(); } } }); }
@Override public Future<Unit> save(int playerId, int notifId) { return worker.cast( () -> { try (Connection co = dataSource.getConnection()) { try (PreparedStatement s = co.prepareStatement( "insert into player_notifs(player_id, notif_id) values(?, ?)")) { s.setInt(1, playerId); s.setInt(2, notifId); s.executeUpdate(); } } }); }