當前位置: 首頁>>代碼示例>>Java>>正文


Java DeleteBuilder.setWhere方法代碼示例

本文整理匯總了Java中com.j256.ormlite.stmt.DeleteBuilder.setWhere方法的典型用法代碼示例。如果您正苦於以下問題:Java DeleteBuilder.setWhere方法的具體用法?Java DeleteBuilder.setWhere怎麽用?Java DeleteBuilder.setWhere使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.j256.ormlite.stmt.DeleteBuilder的用法示例。


在下文中一共展示了DeleteBuilder.setWhere方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: log

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
protected void log(String logName, int priority, String message) {
	if (BuildConfig.DEBUG) {
		android.util.Log.println(priority, LOG_NAME, message);
	}
	try {
		// Store this log message to the database
		errorLogDao.create(new ErrorLogEntry(priority, logName, message));
		// Truncate the error log
		DeleteBuilder<ErrorLogEntry, Integer> db = errorLogDao.deleteBuilder();
		db.setWhere(db.where().le(ErrorLogEntry.DATEANDTIME, new Date(new Date().getTime() - MAX_LOG_AGE)));
		errorLogDao.delete(db.prepare());
	} catch (Exception e) {
		android.util.Log.e(LOG_NAME, "Cannot write log message to database: " + e.toString());
	}
}
 
開發者ID:erickok,項目名稱:transdroid,代碼行數:16,代碼來源:Log.java

示例2: removeByMed

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
public void removeByMed(Medicine med) {
    try {
        DeleteBuilder<PickupInfo, Long> qb = dao.deleteBuilder();
        qb.setWhere(qb.where().eq(PickupInfo.COLUMN_MEDICINE, med));
        qb.delete();
    } catch (SQLException e) {
        throw new RuntimeException("Error deleting pickups by medicine", e);
    }
}
 
開發者ID:citiususc,項目名稱:calendula,代碼行數:10,代碼來源:PickupInfoDao.java

示例3: removeAllFrom

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
public void removeAllFrom(final ScheduleItem scheduleItem) {
    final DeleteBuilder<DailyScheduleItem, Long> db = dao.deleteBuilder();
    try {
        db.setWhere(db.where().eq(DailyScheduleItem.COLUMN_SCHEDULE_ITEM, scheduleItem));
        db.delete();
    } catch (SQLException e) {
        throw new RuntimeException("Error deleting items", e);
    }
}
 
開發者ID:citiususc,項目名稱:calendula,代碼行數:10,代碼來源:DailyScheduleItemDao.java

示例4: removeOlderThan

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
public int removeOlderThan(LocalDate date) {
    try {
        DeleteBuilder<DailyScheduleItem, Long> qb = dao.deleteBuilder();
        qb.setWhere(qb.where().lt(DailyScheduleItem.COLUMN_DATE, date));
        return qb.delete();
    } catch (SQLException e) {
        throw new RuntimeException("Error finding model", e);
    }
}
 
開發者ID:citiususc,項目名稱:calendula,代碼行數:10,代碼來源:DailyScheduleItemDao.java

示例5: removeBeyond

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
public int removeBeyond(LocalDate date) {
    try {
        DeleteBuilder<DailyScheduleItem, Long> qb = dao.deleteBuilder();
        qb.setWhere(qb.where().gt(DailyScheduleItem.COLUMN_DATE, date));
        return qb.delete();
    } catch (SQLException e) {
        throw new RuntimeException("Error finding model", e);
    }
}
 
開發者ID:citiususc,項目名稱:calendula,代碼行數:10,代碼來源:DailyScheduleItemDao.java


注:本文中的com.j256.ormlite.stmt.DeleteBuilder.setWhere方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。