Пример #1
0
  static void saveSections(List<Section> sections) {
    new Delete().from(DBSection.class).execute();

    for (Section section : sections) {
      DBSection s = new DBSection(section);
      s.save();
    }
  }
Пример #2
0
  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;
  }