public void saveGroup(Collection<Group> list, Long facultetId) { try { mDb.beginTransaction(); for (Group group : list) { mSaveGroupStatement.clearBindings(); mSaveGroupStatement.bindLong(1, group.getId()); mSaveGroupStatement.bindString(2, group.getTitle().trim()); mSaveGroupStatement.bindLong(3, group.getLevel()); mSaveGroupStatement.bindLong(4, facultetId); mSaveGroupStatement.execute(); } mDb.setTransactionSuccessful(); } catch (Exception e) { e.printStackTrace(); } finally { mDb.endTransaction(); notifyObservers(); } }