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 synchronized ActiveBluetoothDevice first() { return new Select() .from(ActiveBluetoothDevice.class) .orderBy("_ID asc") .executeSingle(); }
public static List<UserError> all() { return new Select() .from(UserError.class) .orderBy("timestamp desc") .execute(); }
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 Prediction last() { try { return new Select() .from(Prediction.class) .orderBy("timestamp desc") .executeSingle(); } catch (android.database.sqlite.SQLiteException e) { updateDB(); return null; } }
public static StepCounter last() { try { return new Select() .from(StepCounter.class) .orderBy("timestamp desc") .executeSingle(); } catch (android.database.sqlite.SQLiteException e) { fixUpTable(); return null; } }
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 UserNotification lastBgAlert() { return new Select() .from(UserNotification.class) .where("bg_alert = ?", true) .orderBy("_ID desc") .executeSingle(); } public static UserNotification lastCalibrationAlert() {
public static UserNotification lastExtraCalibrationAlert() { return new Select() .from(UserNotification.class) .where("extra_calibration_alert = ?", true) .orderBy("_ID desc") .executeSingle(); }
public static APStatus last() { try { return new Select() .from(APStatus.class) .orderBy("timestamp desc") .executeSingle(); } catch (android.database.sqlite.SQLiteException e) { updateDB(); return null; } }
public static PebbleMovement last() { try { return new Select() .from(PebbleMovement.class) .orderBy("timestamp desc") .executeSingle(); } catch (android.database.sqlite.SQLiteException e) { fixUpTable(); return null; } }
public static SensorSendQueue nextSensorJob() { SensorSendQueue job = new Select() .from(SensorSendQueue.class) .where("success =", false) .orderBy("_ID desc") .limit(1) .executeSingle(); return job; }
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 LibreBlock getLatestForTrend(long start_time, long end_time) { return new Select() .from(LibreBlock.class) .where("bytestart == 0") .where("byteend >= 344") .where("timestamp >= ?", start_time) .where("timestamp <= ?", end_time) .orderBy("timestamp desc") .executeSingle(); }
public static LibreBlock getLatestForTrend(long start_time, long end_time) { return new Select() .from(LibreBlock.class) .where("bytestart == 0") .where("byteend >= 344") .where("timestamp >= ?", start_time) .where("timestamp <= ?", end_time) .orderBy("timestamp desc") .executeSingle(); }
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(); }
public static Calibration getForTimestamp(double timestamp) { Sensor sensor = Sensor.currentSensor(); return new Select() .from(Calibration.class) .where("Sensor = ? ", sensor.getId()) .where("slope_confidence != 0") .where("sensor_confidence != 0") .where("timestamp < ?", timestamp) .orderBy("timestamp desc") .executeSingle(); }