static void saveSections(List<Section> sections) { new Delete().from(DBSection.class).execute(); for (Section section : sections) { DBSection s = new DBSection(section); s.save(); } }
static List<Section> loadSections() { List<DBSection> dSections = new Select().from(DBSection.class).execute(); List<Section> sections = new ArrayList<>(); for (DBSection dSection : dSections) { sections.add(dSection.toSection()); } return sections; }