public int deleteMarkRead() { try { DeleteBuilder<ArticleSyncAction, Integer> deleteBuilder = deleteBuilder(); deleteBuilder.where().eq(COLUMN_ACTION, ArticleSyncAction.Action.MarkRead); return deleteBuilder.delete(); } catch (SQLException e) { throw new RuntimeException(e); } }
public void deleteByDataset(final int dataset) { try { DeleteBuilder<Data, Integer> deleteBuilder = getDataDao().deleteBuilder(); Where<Data, Integer> where = deleteBuilder.where(); where.eq("dataset_id", dataset); deleteBuilder.delete(); } catch (SQLException e) { e.printStackTrace(); } }
@Override public void deleteBySensorRefId(int sensorRefId) { try { DeleteBuilder<Alarm, Integer> deleteBuilder = this.getDao().deleteBuilder(); deleteBuilder.where().eq(Alarm.SENSOR_REF_ID, sensorRefId); int count = deleteBuilder.delete(); _logger.debug("deleted alarms with sensorRefId:[{}], Deletion Count:{}", sensorRefId, count); } catch (SQLException ex) { _logger.error("unable to delete alarms with sensorRefId:[{}]", sensorRefId, ex); } }
public void deleteNoteLite(int memberid) { try { Dao<NoteLite, Integer> dao = getNoteLiteDataDao(); DeleteBuilder<NoteLite, Integer> deleteBuilder = dao.deleteBuilder(); deleteBuilder.where().eq(Constants.memberNotes_UserId, memberid); deleteBuilder.delete(); } catch (SQLException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } }
public void delectedDataFromTable(String[] datetime) { StaticReference.userMf.deleteBuilder(ViewModuleRecord.class).where(); DeleteBuilder<ViewModuleRecord, Long> viewDeleteBuilder = StaticReference.userMf.deleteBuilder(ViewModuleRecord.class); try { viewDeleteBuilder.where().in("datetimes", datetime); viewDeleteBuilder.delete(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
public static int delete( DatabaseHelper databaseHelper, String columnvalue, String originalvalue) { RuntimeExceptionDao<system_messageVo, Integer> system_messageDao = databaseHelper.getSystem_messageDao(); DeleteBuilder<system_messageVo, Integer> deleteBuilder = system_messageDao.deleteBuilder(); try { // 判斷式 哪一欄 = 值 deleteBuilder.where().eq(columnvalue, originalvalue); return deleteBuilder.delete(); } catch (Exception e) { e.printStackTrace(); } return 0; }
public void delete(final Dataset dataset, final Field field, final String data) { try { DeleteBuilder<Data, Integer> deleteBuilder = getDataDao().deleteBuilder(); Where<Data, Integer> where = deleteBuilder.where(); where.eq("dataset_id", dataset); where.and(); where.eq("field_id", field); where.and(); where.eq("data", data); deleteBuilder.delete(); } catch (SQLException e) { e.printStackTrace(); } }
@SuppressWarnings("unchecked") public int deleteMarkStarredAndUnStarred(Article article) { try { DeleteBuilder<ArticleSyncAction, Integer> deleteBuilder = deleteBuilder(); Where<ArticleSyncAction, Integer> where = deleteBuilder.where(); where.and( where.eq(COLUMN_ARTICLEID, article.getId()), where .eq(COLUMN_ACTION, ArticleSyncAction.Action.MarkStarred) .or() .eq(COLUMN_ACTION, ArticleSyncAction.Action.MarkUnstarred)); return deleteBuilder.delete(); } catch (SQLException e) { throw new RuntimeException(e); } }
private void deleteCatagory() { final Dao<CatagoryModel, Integer> catagoryDoa; try { catagoryDoa = getHelper().getCatagoryDao(); DeleteBuilder<CatagoryModel, Integer> deleteBuilder = catagoryDoa.deleteBuilder(); deleteBuilder .where() .eq("categoryId", Integer.valueOf(catagoryModel.getCategoryId())) .and() .eq("catagoryName", catagoryModel.getCatagoryName()); deleteBuilder.delete(); Snackbar snackbar = Snackbar.make(view, "Catagory deleted sucessfully!!", Snackbar.LENGTH_LONG); snackbar.show(); } catch (SQLException e) { e.printStackTrace(); } }
@Override public void tearDown() throws Exception { DeleteBuilder<Card, Long> deleteBuilder = cardDao.deleteBuilder(); deleteBuilder.where().like(Card.Column.TAGS, "test"); deleteBuilder.delete(); }