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


Java DeleteBuilder.where方法代碼示例

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


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

示例1: deleteByColumnName

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
/**
 * 通過表列名來刪除
 *
 * @param map key是列名,value是列對應的值
 * @return
 */
public boolean deleteByColumnName(Map<String, Object> map) {
    int result = 0;
    DeleteBuilder deleteBuilder = ormLiteDao.deleteBuilder();
    Where where = deleteBuilder.where();
    try {
        where.isNotNull("id");
        for (Map.Entry<String, Object> entry : map.entrySet()) {
            where.and().eq(entry.getKey(), entry.getValue());
        }
        result = deleteBuilder.delete();
    } catch (SQLException e) {
        LogUtils.e("delete error,delete line:" + result, e);
        return false;
    }
    return result > 0;
}
 
開發者ID:lujianzhao,項目名稱:AndroidBase,代碼行數:23,代碼來源:OrmLiteDao.java

示例2: deleteTempMessages

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
public void deleteTempMessages(List<Long> dialogOccupantsIdsList) {
    try {
        DeleteBuilder<Message, Long> deleteBuilder = dao.deleteBuilder();

        Where<Message, Long> where = deleteBuilder.where();
        where.and(
                where.in(DialogOccupant.Column.ID, dialogOccupantsIdsList),
                where.or(
                        where.eq(Message.Column.STATE, State.TEMP_LOCAL),
                        where.eq(Message.Column.STATE, State.TEMP_LOCAL_UNREAD)
                )
        );

        if (deleteBuilder.delete() > 0) {
            //TODO VT need to think how to send IDs to observers
            notifyObserversDeletedById(dialogOccupantsIdsList);
        }
    } catch (SQLException e) {
        ErrorUtils.logError(e);
    }

}
 
開發者ID:QuickBlox,項目名稱:q-municate-android,代碼行數:23,代碼來源:MessageDataManager.java

示例3: deleteMarkReadAndUnread

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public int deleteMarkReadAndUnread(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.MarkRead)
					.or().eq(COLUMN_ACTION, ArticleSyncAction.Action.MarkUnread));
		return deleteBuilder.delete();
	} catch (SQLException e) {
		throw new RuntimeException(e);
	}
}
 
開發者ID:yDelouis,項目名稱:selfoss-android,代碼行數:14,代碼來源:ArticleSyncActionDao.java

示例4: deleteMarkStarredAndUnStarred

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
@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);
	}
}
 
開發者ID:yDelouis,項目名稱:selfoss-android,代碼行數:14,代碼來源:ArticleSyncActionDao.java


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