当前位置: 首页>>代码示例>>Java>>正文


Java Dao.deleteBuilder方法代码示例

本文整理汇总了Java中com.j256.ormlite.dao.Dao.deleteBuilder方法的典型用法代码示例。如果您正苦于以下问题:Java Dao.deleteBuilder方法的具体用法?Java Dao.deleteBuilder怎么用?Java Dao.deleteBuilder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.j256.ormlite.dao.Dao的用法示例。


在下文中一共展示了Dao.deleteBuilder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onUpgrade

import com.j256.ormlite.dao.Dao; //导入方法依赖的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

示例2: clearHistory

import com.j256.ormlite.dao.Dao; //导入方法依赖的package包/类
private void clearHistory() {
    try {
        Dao<DetectedOverlay, Integer> detectedOverlayDao = DatabaseHelper.getHelper(getActivity()).getDetectedOverlayDao();
        DeleteBuilder<DetectedOverlay, Integer> deleteBuilder = detectedOverlayDao.deleteBuilder();
        deleteBuilder.where().gt("id", 0);
        int deleted = deleteBuilder.delete();
        Log.i(getTag(), "Deleted " + deleted + " entries from DetectedOverlay");
    } catch (SQLException e) {
        Log.e(getTag(), "Failed to deleted entries", e);
    }
    mAdapter.clear();
}
 
开发者ID:geeksonsecurity,项目名称:android-overlay-protection,代码行数:13,代码来源:DetectedOverlayFragment.java


注:本文中的com.j256.ormlite.dao.Dao.deleteBuilder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。