Example #1
0
 public void DeleteCollection(int id) {
   try {
     List<Book> books = helper.Books().queryForEq("Collection", id);
     Collection defColl = helper.Collections().queryForEq("Name", "д╛хо").get(0);
     for (Book book : books) {
       book.setCollection(defColl.getId());
       helper.Books().update(book);
     }
     helper.Collections().deleteById(id);
   } catch (SQLException e) {
     e.printStackTrace();
   }
 }
Example #2
0
 public void DeleteCollection(String name) {
   try {
     DeleteCollection(helper.Collections().queryForEq("Name", name).get(0).getId());
   } catch (SQLException e) {
     e.printStackTrace();
   }
 }
Example #3
0
 public void AddCollection(Collection collection) {
   try {
     helper.Collections().create(collection);
   } catch (SQLException e) {
     e.printStackTrace();
   }
 }
Example #4
0
 public List<Collection> GetAllCollections() {
   try {
     return helper.Collections().queryForAll();
   } catch (SQLException e) {
     e.printStackTrace();
   }
   return null;
 }