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


Java RealmResults.deleteAllFromRealm方法代码示例

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


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

示例1: btn_logout_click

import io.realm.RealmResults; //导入方法依赖的package包/类
public void btn_logout_click(View v) {
    RealmConfiguration config = new RealmConfiguration.Builder().name("yyox.realm").build();
    Realm objRealm = Realm.getInstance(config);

    //查找
    RealmUser realmUser = objRealm.where(RealmUser.class).findFirst();
    if (realmUser != null) {
        //先删除
        objRealm.beginTransaction();
        RealmResults results = objRealm.where(RealmUser.class).findAll();
        results.deleteAllFromRealm();
        objRealm.commitTransaction();

    }
    mPresenter.requestLogout(this);
    WEApplication weApplication = (WEApplication) getApplication();
    weApplication.setRealmUser(null);

    Intent intent = new Intent();
    setResult(CodeDefine.SETTING_RESULT, intent);
}
 
开发者ID:Zyj163,项目名称:yyox,代码行数:22,代码来源:UserSettingActivity.java

示例2: logoutRealmUser

import io.realm.RealmResults; //导入方法依赖的package包/类
private void logoutRealmUser() {
    //注册成功写数据库
    RealmConfiguration config = new RealmConfiguration.Builder().name("yyox.realm").build();
    Realm objRealm = Realm.getInstance(config);

    //查找
    RealmUser realmUser = objRealm.where(RealmUser.class).findFirst();
    if (realmUser != null) {
        //先删除
        objRealm.beginTransaction();
        RealmResults results = objRealm.where(RealmUser.class).findAll();
        results.deleteAllFromRealm();
        objRealm.commitTransaction();
        //再添加
        objRealm.beginTransaction();
        RealmUser realmUserNew = objRealm.createObject(RealmUser.class);
        realmUserNew.setName("");
        objRealm.commitTransaction();

        mRealmUser = null;
    }
}
 
开发者ID:Zyj163,项目名称:yyox,代码行数:23,代码来源:WEApplication.java

示例3: deleteProfil

import io.realm.RealmResults; //导入方法依赖的package包/类
/**
 * method menghapus Profil berdasarkan id
 *
 * @param id
 */
public void deleteProfil(int id) {
    realm.beginTransaction();
    RealmResults<Profil> dataResults = realm.where(Profil.class).equalTo("id", id).findAll();

    dataResults.deleteAllFromRealm();

    realm.commitTransaction();

    showToast("Hapus data berhasil.");
}
 
开发者ID:setakarim,项目名称:ingetin,代码行数:16,代码来源:RealmHelper.java

示例4: deleteAkademmik

import io.realm.RealmResults; //导入方法依赖的package包/类
/**
 * method menghapus Akademik berdasarkan id
 *
 * @param id
 */
public void deleteAkademmik(int id) {
    realm.beginTransaction();
    RealmResults<Akademik> dataResults = realm.where(Akademik.class).equalTo("id", id).findAll();

    dataResults.deleteAllFromRealm();

    realm.commitTransaction();

    showToast("Hapus data berhasil.");
}
 
开发者ID:setakarim,项目名称:ingetin,代码行数:16,代码来源:RealmHelper.java

示例5: deleteOrganisasi

import io.realm.RealmResults; //导入方法依赖的package包/类
/**
 * method menghapus Organisasi berdasarkan id
 *
 * @param id
 */
public void deleteOrganisasi(int id) {
    realm.beginTransaction();
    RealmResults<Organisasi> dataResults = realm.where(Organisasi.class).equalTo("id", id).findAll();

    dataResults.deleteAllFromRealm();

    realm.commitTransaction();

    showToast("Hapus data berhasil.");
}
 
开发者ID:setakarim,项目名称:ingetin,代码行数:16,代码来源:RealmHelper.java

示例6: deleteLainnya

import io.realm.RealmResults; //导入方法依赖的package包/类
/**
 * method menghapus Lainnya berdasarkan id
 *
 * @param id
 */
public void deleteLainnya(int id) {
    realm.beginTransaction();
    RealmResults<Lainnya> dataResults = realm.where(Lainnya.class).equalTo("id", id).findAll();

    dataResults.deleteAllFromRealm();

    realm.commitTransaction();

    showToast("Hapus data berhasil.");
}
 
开发者ID:setakarim,项目名称:ingetin,代码行数:16,代码来源:RealmHelper.java

示例7: delete

import io.realm.RealmResults; //导入方法依赖的package包/类
public static <O extends  RealmObject> void delete(Realm realmInstance, QueryFilters filters, Class<O> clazz){
    Realm realm = realmInstance;
    realm.beginTransaction();
    RealmQuery<O> query = realm.where(clazz);
    query = filters.copyToRealmQuery(query);
    final RealmResults<O> results = query.findAll();
    results.deleteAllFromRealm();
    realm.commitTransaction();
    realm.close();
}
 
开发者ID:rezkyatinnov,项目名称:kyandroid,代码行数:11,代码来源:LocalData.java

示例8: saveContacts

import io.realm.RealmResults; //导入方法依赖的package包/类
/**
 * save contacts data into local storage
 * @param contacts
 */
public static void saveContacts(final RealmList<RealmContact> contacts ){
    Realm realm = Realm.getDefaultInstance();
    realm.beginTransaction();
    final RealmResults<RealmContact> results = realm.where(RealmContact.class).findAll();
    results.deleteAllFromRealm();
    realm.copyToRealmOrUpdate(contacts);
    realm.commitTransaction();
}
 
开发者ID:AppHero2,项目名称:Raffler-Android,代码行数:13,代码来源:AppManager.java

示例9: removeBookFromDatabase

import io.realm.RealmResults; //导入方法依赖的package包/类
public void removeBookFromDatabase(String id) {
    Realm realm = Realm.getDefaultInstance();
    realm.beginTransaction();
    RealmResults<BookDB> results = realm.where(BookDB.class).equalTo("idBook", id).findAll();
    results.deleteAllFromRealm();
    realm.commitTransaction();
}
 
开发者ID:OlegKlimenko,项目名称:Plamber-Android,代码行数:8,代码来源:BookUtilsDB.java

示例10: deleteAllFromDB

import io.realm.RealmResults; //导入方法依赖的package包/类
public void deleteAllFromDB() {
    Realm realm = Realm.getDefaultInstance();
    realm.beginTransaction();
    RealmResults<BookDB> results = realm.where(BookDB.class).findAll();
    results.deleteAllFromRealm();
    realm.commitTransaction();
}
 
开发者ID:OlegKlimenko,项目名称:Plamber-Android,代码行数:8,代码来源:BookUtilsDB.java

示例11: Reset

import io.realm.RealmResults; //导入方法依赖的package包/类
public void Reset(){
    RealmResults<StepCounts> results = realm.where(StepCounts.class).findAll();

    realm.beginTransaction();

    results.deleteAllFromRealm();

    realm.commitTransaction();
}
 
开发者ID:PacktPublishing,项目名称:Android-Wear-Projects,代码行数:10,代码来源:MainActivity.java

示例12: deleteRecord

import io.realm.RealmResults; //导入方法依赖的package包/类
public void deleteRecord(String id){
    RealmResults<Note> results = realm.where(Note.class).equalTo("id", id).findAll();

    realm.beginTransaction();

    results.deleteAllFromRealm();

    realm.commitTransaction();
}
 
开发者ID:PacktPublishing,项目名称:Android-Wear-Projects,代码行数:10,代码来源:MainActivity.java


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