public List<AlarmModel> getAll() { List<AlarmModel> alarmList = new ArrayList<>(); for (LinkedHashMap<String, Column> m : alarmTable.getAllRows()) { alarmList.add(getValues(m)); } database.closeDatabase(); return alarmList; }
// Delete all data public void clearAll() { alarmTable.clearAll(); database.closeDatabase(); }
public int update(AlarmModel entry) { int TempInt = (int) alarmTable.update(putValues(entry), KEY); database.closeDatabase(); return TempInt; }
public AlarmModel get(int id) { LinkedHashMap<String, Column> m = alarmTable.getRowByValue(KEY, id).getMap(); AlarmModel alarm = getValues(m); database.closeDatabase(); return alarm; }
public long addAndGetID(AlarmModel entry) { long value = alarmTable.addRow(putValues(entry)); database.closeDatabase(); return value; }
public void add(AlarmModel entry) { alarmTable.addRow(putValues(entry)); database.closeDatabase(); }
// Drop public void drop() { alarmTable.drop(); database.closeDatabase(); }
// Deleting single entry public void delete(AlarmModel entry) { alarmTable.delete(KEY, entry.getId()); database.closeDatabase(); }