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


Java DeleteBuilder.delete方法代碼示例

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


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

示例1: deleteAll

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
@Override
public int deleteAll()
{
	try
	{
		DeleteBuilder<FocusItemInfo, Long> deleteBuilder = mFocusItemInfoDao.deleteBuilder();
		deleteBuilder.where().isNotNull("id");
		return deleteBuilder.delete();
	}
	catch (SQLException e)
	{
		e.printStackTrace();
	}
	
	return super.deleteAll();
}
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:17,代碼來源:LocalAlbumBiz.java

示例2: deleteAll

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
@Override
public int deleteAll()
{
	try
	{
		DeleteBuilder<MyFavorites, Long> deleteBuilder = mMyFavoritesDao.deleteBuilder();
		deleteBuilder.where().isNotNull("albumid");
		
		return deleteBuilder.delete();
	}
	catch (SQLException e)
	{
		e.printStackTrace();
	}
	
	return super.deleteAll();
}
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:18,代碼來源:MyFavoritesBiz.java

示例3: deleteByAlbumid

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
/**
 * 
 * @param albumid
 * @return
 */
public int deleteByAlbumid(String albumid)
{
	try
	{
		DeleteBuilder<PhotoInfo, Long> deleteBuilder = mPhotoDao.deleteBuilder();
		deleteBuilder.where().eq("albumid", albumid);
		return deleteBuilder.delete();
	}
	catch (SQLException e)
	{
		e.printStackTrace();
	}
	
	return super.deleteAll();
}
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:21,代碼來源:PhotoBiz.java

示例4: deleteAll

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
@Override
public int deleteAll()
{
	try
	{
		DeleteBuilder<AlbumInfo, Long> deleteBuilder = mAlbumDao.deleteBuilder();
		deleteBuilder.where().isNotNull("albumid");
		return deleteBuilder.delete();
	}
	catch (SQLException e)
	{
		e.printStackTrace();
	}
	
	return super.deleteAll();
}
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:17,代碼來源:AlbumBiz.java

示例5: onUpgrade

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
/**
 * This is called when your application is upgraded and it has a higher version number. This allows you to adjust
 * the various data to match the new version number.
 */
@Override
public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int oldVersion, int newVersion) {
    try {
        Log.i(TAG, "onUpgrade");
        TableUtils.dropTable(connectionSource, SuspectedApp.class, true);
        Log.d(TAG, String.format("Dropped suspected app table!"));
        Dao<WhiteEntry, Integer> whiteListDao = getWhiteListDao();
        DeleteBuilder<WhiteEntry, Integer> deleteBuilder = whiteListDao.deleteBuilder();
        deleteBuilder.where().eq("systemEntry", Boolean.TRUE);
        int deleted = deleteBuilder.delete();
        Log.d(TAG, String.format("Delete %d old system whitelist entries", deleted));
        onCreate(db, connectionSource);
    } catch (SQLException e) {
        Log.e(TAG, "Can't drop databases", e);
        throw new RuntimeException(e);
    }
}
 
開發者ID:geeksonsecurity,項目名稱:android-overlay-protection,代碼行數:22,代碼來源:DatabaseHelper.java

示例6: saveEventGuestOutfitsToDb

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
private void saveEventGuestOutfitsToDb(Set<EventGuestOutfit> eventGuestOutfits, Set<EventGuestOutfitItem> eventGuestOutfitItems) throws SQLException {
    for(EventGuestOutfit eventGuestOutfit : eventGuestOutfits) {
        Log.i(TAG, "Saving " + eventGuestOutfit.getClass().getSimpleName() + " uuid: " + eventGuestOutfit.getUuid());

        // Save outfit
        mHelper.getEventGuestOutfitDao().createOrUpdate(eventGuestOutfit);

        // Delete existing outfit items
        DeleteBuilder<EventGuestOutfitItem, String> deleteBuilder = mHelper.getEventGuestOutfitItemDao().deleteBuilder();
        deleteBuilder.where().eq("event_guest_outfit_uuid", eventGuestOutfit.getUuid());
        deleteBuilder.delete();

        // Create new outfit items
        for(EventGuestOutfitItem eventGuestOutfitItem : eventGuestOutfitItems) {
            if(eventGuestOutfit.getUuid().equals(eventGuestOutfitItem.getEventGuestOutfit().getUuid())) {
                mHelper.getItemDao().createIfNotExists(eventGuestOutfitItem.getItem());
                mHelper.getEventGuestOutfitItemDao().create(eventGuestOutfitItem);
            }
        }
    }
}
 
開發者ID:joeydeluca,項目名稱:apparel,代碼行數:22,代碼來源:ApparelSyncAdapter.java

示例7: storeFeed

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
private void storeFeed(FeedUserRequest request, TopicsListResponse response,
	int feedType, String query) throws SQLException {

	DebugTimer.startInterval("saving topic feed");
	if (TextUtils.isEmpty(request.getCursor())) {
		DeleteBuilder<TopicFeedRelation, Integer> deleteBuilder = feedDao.deleteBuilder();
		String userHandleQuery = (query != null) ? query : TopicFeedRelation.DEFAULT_QUERY;
		deleteBuilder.where()
			.eq(DbSchemas.TopicFeedRelation.FEED_TYPE, feedType)
			.and().eq(DbSchemas.TopicFeedRelation.QUERY, userHandleQuery);
		deleteBuilder.delete();
	}
	DbTransaction.performTransaction(
		topicDao,
		() -> insertTopicFeedContents(response.getData(), feedType, query)
	);
	DebugTimer.endInterval();
	DebugLog.i("stored " + response.getData().size() + " topics for " + request);
}
 
開發者ID:Microsoft,項目名稱:EmbeddedSocial-Android-SDK,代碼行數:20,代碼來源:ContentCache.java

示例8: removeComment

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
/**
 * Removes a comment.
 * @param commentHandle comment handle
 */
public void removeComment(String commentHandle) {
	DeleteBuilder<CommentFeedRelation, Integer> deleteBuilder = commentFeedDao.deleteBuilder();
	try {
		String topicHandle = getCommentParentHandle(commentHandle);
		deleteBuilder.where().eq(DbSchemas.CommentFeedRelation.COMMENT_HANDLE, commentHandle);
		deleteBuilder.delete();
		if (!TextUtils.isEmpty(topicHandle)) {
			UpdateBuilder<TopicView, String> updateBuilder = topicDao.updateBuilder();
			updateBuilder.where()
				.eq(DbSchemas.Topics.TOPIC_HANDLE, topicHandle)
				.and().gt(DbSchemas.Topics.TOTAL_COMMENTS, 0);
			updateBuilder.updateColumnExpression(
				DbSchemas.Topics.TOTAL_COMMENTS,
				DbSchemas.Topics.TOTAL_COMMENTS + " - 1");
			updateBuilder.update();
		}
	} catch (SQLException e) {
		DebugLog.logException(e);
	}
}
 
開發者ID:Microsoft,項目名稱:EmbeddedSocial-Android-SDK,代碼行數:25,代碼來源:ContentCache.java

示例9: 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

示例10: 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

示例11: addOrUpdateRace

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
public boolean addOrUpdateRace(Race race) {
    try {
        CreateOrUpdateStatus status = mHelper.getRaceDao().createOrUpdate(race);

        for (Rule rule : race.getRules()) {
            rule.setRace(race);

            // Rules could have been added or removed, so remove persisted
            // rules and add current rules
            if (status.isUpdated()) {
                DeleteBuilder<Rule, Long> deleteBuilder = mHelper.getRuleDao().deleteBuilder();
                deleteBuilder.where().eq("ruleId", rule.getRuleId()).and().eq("race_id", race.getRaceId());
                deleteBuilder.delete();
            }

            mHelper.getRuleDao().createOrUpdate(rule);
        }

        return true;
    } catch (SQLException e) {
        Log.e(TAG, "Failed to cache a race", e);
        return false;
    }
}
 
開發者ID:jrobinson3k1,項目名稱:Path-of-Exile-Racer,代碼行數:25,代碼來源:DatabaseManager.java

示例12: deleteAllEsami

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
@Override
public void deleteAllEsami() throws SQLException {
	boolean result = false;
	if (this.databaseHelper != null && this.databaseHelper.isOpen()) {

		DeleteBuilder<EsameEntity, Integer> deleteBuilder = databaseHelper.getEsameEntityDao().deleteBuilder();
		deleteBuilder.delete();
		result = true;

	}
	if (result == true) {
		Log.v(TAG, "Database is now empty");

	}

}
 
開發者ID:nicky1525,項目名稱:UniApp,代碼行數:17,代碼來源:DBHandler.java

示例13: delete

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
@Override
public int delete(OMRegionInteraction relation) throws SQLException {
	DeleteBuilder<OMRegionInteraction, String> deleteBuilder = this.deleteBuilder();
	deleteBuilder.where().eq("region_id", relation.getRegion().getID()).and().eq("interaction_id", relation.getInteraction().getID());
	deleteBuilder.delete();
	return 1;
}
 
開發者ID:ForJ-Latech,項目名稱:fwm,代碼行數:8,代碼來源:OMRegionInteractionDaoImpl.java

示例14: delete

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
@Override
public int delete(MMTemplateEvent relation) throws SQLException {
	DeleteBuilder<MMTemplateEvent, String> deleteBuilder = this.deleteBuilder();
	deleteBuilder.where().eq("template_id", relation.getTemplate().getID()).and().eq("event_id", relation.getEvent().getID());
	deleteBuilder.delete();
	return 1;
}
 
開發者ID:ForJ-Latech,項目名稱:fwm,代碼行數:8,代碼來源:MMTemplateEventDaoImpl.java

示例15: delete

import com.j256.ormlite.stmt.DeleteBuilder; //導入方法依賴的package包/類
@Override
public int delete(MMTemplateRegion relation) throws SQLException {
	DeleteBuilder<MMTemplateRegion, String> deleteBuilder = this.deleteBuilder();
	deleteBuilder.where().eq("template_id", relation.getTemplate().getID()).and().eq("region_id", relation.getRegion().getID());
	deleteBuilder.delete();
	return 1;
}
 
開發者ID:ForJ-Latech,項目名稱:fwm,代碼行數:8,代碼來源:MMTemplateRegionDaoImpl.java


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