当前位置: 首页>>代码示例>>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;未经允许,请勿转载。