public static void deleteAll() { new Delete() .from(DesertSync.class) .execute(); }
public static void deleteAll() { new Delete() .from(DesertSync.class) .execute(); }
public static void delete_all(boolean from_interactive) { if (from_interactive) { //GcmActivity.push_delete_all_treatments(); } new Delete() .from(Treatments.class) .execute(); // not synced with uploader queue - should we? }
public static void clearAll(){ List<CalibrationRequest> calibrationRequests = new Select() .from(CalibrationRequest.class) .execute(); if (calibrationRequests.size() >=1) { for (CalibrationRequest calibrationRequest : calibrationRequests) { calibrationRequest.delete(); } } }
public static List<Calibration> futureCalibrations() { double timestamp = new Date().getTime(); return new Select() .from(Calibration.class) .where("timestamp > " + timestamp) .orderBy("timestamp desc") .execute(); }
public static List<Calibration> futureCalibrations() { double timestamp = new Date().getTime(); return new Select() .from(Calibration.class) .where("timestamp > " + timestamp) .orderBy("timestamp desc") .execute(); }
public static List<Treatments> latestForGraph(int number, double startTime, double endTime) { fixUpTable(); DecimalFormat df = new DecimalFormat("#"); df.setMaximumFractionDigits(1); // are there decimal points in the database?? return new Select() .from(Treatments.class) .where("timestamp >= ? and timestamp <= ?", df.format(startTime), df.format(endTime)) .orderBy("timestamp asc") .limit(number) .execute(); }
public static void delete_all(boolean from_interactive) { if (from_interactive) { GcmActivity.push_delete_all_treatments(); } new Delete() .from(Treatments.class) .execute(); // not synced with uploader queue - should we? }
public static List<UserError> all() { return new Select() .from(UserError.class) .orderBy("timestamp desc") .execute(); }
@Deprecated public static List<BgSendQueue> cleanQueue() { return new Delete() .from(BgSendQueue.class) .where("mongo_success = ?", true) .where("operation_type = ?", "create") .execute(); }
public static void delete_all(boolean from_interactive) { if (from_interactive) { GcmActivity.push_delete_all_treatments(); } new Delete() .from(Treatments.class) .execute(); // not synced with uploader queue - should we? }
public static List<BloodTest> latest(int number) { try { return new Select() .from(BloodTest.class) .orderBy("timestamp desc") .limit(number) .execute(); } catch (android.database.sqlite.SQLiteException e) { fixUpTable(); return new ArrayList<>(); } }
public static List<BloodTest> cleanup(int retention_days) { return new Delete() .from(BloodTest.class) .where("timestamp < ?", JoH.tsl() - (retention_days * Constants.DAY_IN_MS)) .execute(); }
public static List<BloodTest> cleanup(int retention_days) { return new Delete() .from(BloodTest.class) .where("timestamp < ?", JoH.tsl() - (retention_days * Constants.DAY_IN_MS)) .execute(); }
public static List<Reminder> getAllReminders() { fixUpTable(schema); final List<Reminder> reminders = new Select() .from(Reminder.class) .orderBy("enabled desc, priority desc, next_due asc") .execute(); return reminders; }
public static List<BgReading> cleanup(int retention_days) { return new Delete() .from(BgReading.class) .where("timestamp < ?", JoH.tsl() - (retention_days * Constants.DAY_IN_MS)) .execute(); }
public static List<Treatments> last(int num) { try { return new Select() .from(Treatments.class) .orderBy("timestamp desc") .limit(num) .execute(); } catch (android.database.sqlite.SQLiteException e) { fixUpTable(); return null; } }
public static List<BgReading> latestForGraphAsc(int number, long startTime, long endTime) {//KS return new Select() .from(BgReading.class) .where("timestamp >= " + Math.max(startTime, 0)) .where("timestamp <= " + endTime) .where("calculated_value != 0") .where("raw_data != 0") .orderBy("timestamp asc") .limit(number) .execute(); }
public static List<Calibration> latest(int number) { Sensor sensor = Sensor.currentSensor(); if (sensor == null) { return null; } return new Select() .from(Calibration.class) .where("Sensor = ? ", sensor.getId()) .orderBy("timestamp desc") .limit(number) .execute(); }
public static List<BgReading> latest_by_size(int number) { final Sensor sensor = Sensor.currentSensor(); if (sensor == null) return null; return new Select() .from(BgReading.class) .where("Sensor = ? ", sensor.getId()) .where("raw_data != 0") .orderBy("timestamp desc") .limit(number) .execute(); }