• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java WhereBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.litesuits.orm.db.assit.WhereBuilder的典型用法代码示例。如果您正苦于以下问题:Java WhereBuilder类的具体用法?Java WhereBuilder怎么用?Java WhereBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WhereBuilder类属于com.litesuits.orm.db.assit包,在下文中一共展示了WhereBuilder类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: deleteWhere

import com.litesuits.orm.db.assit.WhereBuilder; //导入依赖的package包/类
/**
 * 删除所有 某字段 等于 vlaue 的值
 */
public <T> Observable<Integer> deleteWhere(final Class<T> cls, final String where, final String[] value) {
    return Observable.defer(new Func0<Observable<Integer>>() {
        @Override
        public Observable<Integer> call() {
            return Observable.just(liteOrm.delete(new WhereBuilder(cls).where(where + "=?", value)));
        }
    }).subscribeOn(Schedulers.io());
}
 
开发者ID:SamuelGjk,项目名称:GComic,代码行数:12,代码来源:GComicDB.java


示例2: initView

import com.litesuits.orm.db.assit.WhereBuilder; //导入依赖的package包/类
private void initView() {
    mWeathers = new ArrayList<>();
    mAdapter = new MultiCityAdapter(mWeathers);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    mRecyclerView.setAdapter(mAdapter);
    mAdapter.setMultiCityClick(new MultiCityAdapter.onMultiCityClick() {
        @Override
        public void longClick(String city) {
            new AlertDialog.Builder(getActivity())
                .setMessage("是否删除该城市?")
                .setPositiveButton("删除", (dialog, which) -> {
                    OrmLite.getInstance().delete(new WhereBuilder(CityORM.class).where("name=?", city));
                    multiLoad();
                    Snackbar.make(getView(), String.format(Locale.CHINA, "已经将%s删掉了 Ծ‸ Ծ", city), Snackbar.LENGTH_LONG)
                        .setAction("撤销",
                            v -> {
                                OrmLite.getInstance().save(new CityORM(city));
                                multiLoad();
                            }).show();
                })
                .show();
        }

        @Override
        public void click(Weather weather) {
            DetailCityActivity.launch(getActivity(), weather);
        }
    });

    if (mRefreshLayout != null) {
        mRefreshLayout.setColorSchemeResources(
            android.R.color.holo_orange_light,
            android.R.color.holo_red_light,
            android.R.color.holo_green_light,
            android.R.color.holo_blue_bright
        );
        mRefreshLayout.setOnRefreshListener(() -> mRefreshLayout.postDelayed(this::multiLoad, 1000));
    }
}
 
开发者ID:xcc3641,项目名称:SeeWeather,代码行数:40,代码来源:MultiCityFragment.java


示例3: disposeFailureInfo

import com.litesuits.orm.db.assit.WhereBuilder; //导入依赖的package包/类
private static Consumer<Throwable> disposeFailureInfo(Throwable t) {
    return throwable -> {
        if (t.toString().contains("GaiException") || t.toString().contains("SocketTimeoutException") ||
            t.toString().contains("UnknownHostException")) {
            ToastUtil.showShort("网络问题");
        } else if (t.toString().contains("API没有")) {
            OrmLite.getInstance()
                .delete(new WhereBuilder(CityORM.class).where("name=?", Util.replaceInfo(t.getMessage())));
            ToastUtil.showShort("错误: " + t.getMessage());
        }
        PLog.w(t.getMessage());
    };
}
 
开发者ID:xcc3641,项目名称:SeeWeather,代码行数:14,代码来源:RetrofitSingleton.java


示例4: disposeFailureInfo

import com.litesuits.orm.db.assit.WhereBuilder; //导入依赖的package包/类
public static void disposeFailureInfo(Throwable t) {
    if (t.toString().contains("GaiException") || t.toString().contains("SocketTimeoutException") ||
        t.toString().contains("UnknownHostException")) {
        ToastUtil.showShort("网络问题");
    } else if (t.toString().contains("API没有")) {
        OrmLite.getInstance().delete(new WhereBuilder(CityORM.class).where("name=?", Util.replaceInfo(t.getMessage())));
        PLog.w(Util.replaceInfo(t.getMessage()));
        ToastUtil.showShort(t.getMessage());
    }
    PLog.w(t.getMessage());
}
 
开发者ID:JasonChow1989,项目名称:SeeWeather-master,代码行数:12,代码来源:RetrofitSingleton.java


示例5: favoriteGril

import com.litesuits.orm.db.assit.WhereBuilder; //导入依赖的package包/类
@OnClick(R.id.fav)
public void favoriteGril() {
    if (mIsGirlCollected) {
        MyApp.mLiteOrm.delete(GirlCollect.class,
                WhereBuilder.create(GirlCollect.class).equals("girlUrl", mMeizhiUrl));
        mIsGirlCollected = false;
        mFavFAB.setImageResource(R.mipmap.ab_fav_normal);
        toast("取消收藏妹纸...");
    } else {
        saveMeizhi();
        mFavFAB.setImageResource(R.mipmap.ab_fav_active);
        mIsGirlCollected = true;
        toast("成功收藏妹纸...");
    }   }
 
开发者ID:Assassinss,项目名称:smile,代码行数:15,代码来源:MeizhiActivity.java


示例6: testDeleteByWhereBuilder

import com.litesuits.orm.db.assit.WhereBuilder; //导入依赖的package包/类
private void testDeleteByWhereBuilder() {
    // 删除 student-1
    liteOrm.delete(new WhereBuilder(Student.class)
            .where(Person.COL_NAME + " LIKE ?", new String[]{"%1%"})
            .and()
            .greaterThan("id", 0)
            .and()
            .lessThan("id", 10000));
}
 
开发者ID:litesuits,项目名称:android-lite-orm,代码行数:10,代码来源:CascadeTestActivity.java


示例7: testDeleteByWhereBuilder

import com.litesuits.orm.db.assit.WhereBuilder; //导入依赖的package包/类
private void testDeleteByWhereBuilder() {
    //AND关系 删掉 南京 的 香港路 第一种写法
    liteOrm.delete(WhereBuilder
            .create(Address.class)
            .equals(Address.COL_ADDRESS, "香港路")
            .andEquals(Address.COL_CITY, "南京"));

    //AND关系 删掉 南京 的 香港路 第二种写法
    liteOrm.delete(WhereBuilder
            .create(Address.class)
            .where("address=? AND city=?", new String[]{"香港路", "南京"}));

    //AND关系 删掉 南京 的 香港路 第三种写法
    liteOrm.delete(WhereBuilder
            .create(Address.class)
            .where("address=? AND city=?", "香港路", "南京"));

    printAllAddress();

    //OR关系 删掉所有地址为 香港路 ,同时删掉 青岛的所有地址
    liteOrm.delete(WhereBuilder
            .create(Address.class)
            .equals(Address.COL_ADDRESS, "香港路")
            .orEquals(Address.COL_CITY, "青岛"));
    printAllAddress();

    //IN语句 删掉所有城市为 杭州 或 北京的地址
    liteOrm.delete(WhereBuilder
            .create(Address.class)
            .in(Address.COL_CITY, new String[]{"杭州", "北京"}));
    printAllAddress();

    //IN语句 删掉所有 非香港路 并且 ID>10
    liteOrm.delete(WhereBuilder
            .create(Address.class)
            .equals(Address.COL_ADDRESS, "夫子庙")
            .and()
            .greaterThan(Address.COL_ID, 5));
    printAllAddress();
}
 
开发者ID:litesuits,项目名称:android-lite-orm,代码行数:41,代码来源:SingleTestActivity.java


示例8: remove

import com.litesuits.orm.db.assit.WhereBuilder; //导入依赖的package包/类
@Override
public void remove(String key) {

    Arad.db.getLiteOrm().delete(new WhereBuilder(SearchHistoryModel.class, "content=?", new String[]{key}));
}
 
开发者ID:beanu,项目名称:smart-farmer-android,代码行数:6,代码来源:SearchModelImpl.java


示例9: remove

import com.litesuits.orm.db.assit.WhereBuilder; //导入依赖的package包/类
@Override
public final boolean remove(String key) {
    int result = mLiteOrm.delete(new WhereBuilder(CacheEntry.class)
            .where(CacheEntry.COL_KEY + " = ?", "%"+key+"%"));
    return result > 0;
}
 
开发者ID:LittleFriendsGroup,项目名称:KakaCache-RxJava,代码行数:7,代码来源:BasicDiskJournal.java


示例10: initView

import com.litesuits.orm.db.assit.WhereBuilder; //导入依赖的package包/类
private void initView() {
    weatherArrayList = new ArrayList<>();
    mAdatper = new MultiCityAdapter(getActivity(), weatherArrayList);
    mRecyclerview.setLayoutManager(new LinearLayoutManager(getActivity()));
    mRecyclerview.setAdapter(mAdatper);
    mAdatper.setOnMultiCityLongClick(new MultiCityAdapter.onMultiCityLongClick() {
        @Override
        public void longClick(String city) {
            new AlertDialog.Builder(getActivity()).setMessage("是否删除该城市?")
                .setPositiveButton("删除", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        OrmLite.getInstance().delete(new WhereBuilder(CityORM.class).where("name=?", city));
                        OrmLite.OrmTest(CityORM.class);
                        multiLoad();
                        Snackbar.make(getView(), "已经将" + city + "删掉了 Ծ‸ Ծ", Snackbar.LENGTH_LONG).setAction("撤销",
                            new View.OnClickListener() {
                                @Override
                                public void onClick(View v) {
                                    OrmLite.getInstance().save(new CityORM(city));
                                    multiLoad();
                                }
                            }).show();
                    }
                })
                .show();
        }
    });

    if (mSwiprefresh != null) {
        mSwiprefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
            @Override
            public void onRefresh() {
                mSwiprefresh.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        multiLoad();
                    }
                }, 1000);
            }
        });
    }
}
 
开发者ID:JasonChow1989,项目名称:SeeWeather-master,代码行数:44,代码来源:MultiCityFragment.java


示例11: deleteApp

import com.litesuits.orm.db.assit.WhereBuilder; //导入依赖的package包/类
public static void deleteApp(AppInfo info) {
    NotificationBoxApp.getLiteOrm().delete(new WhereBuilder(AppInfo.class)
            .where("packageName = ?", info.getPackageName()));
}
 
开发者ID:gavinliu,项目名称:NotificationBox,代码行数:5,代码来源:DbUtils.java


示例12: deleteByWhereBuilder

import com.litesuits.orm.db.assit.WhereBuilder; //导入依赖的package包/类
public <T> int deleteByWhereBuilder(Class<T> clazz, String column, Object value) {
    LiteOrm lOrm = liteOrm.single();
    return lOrm.delete(new WhereBuilder(clazz).equals(column, value));
}
 
开发者ID:MPDL,项目名称:LabCam,代码行数:5,代码来源:LiteOrmManager.java


示例13: deleteWhere

import com.litesuits.orm.db.assit.WhereBuilder; //导入依赖的package包/类
/**
 * 删除所有 某字段等于 Vlaue的值
 *
 * @param cla
 * @param field
 * @param value
 */
public static <T> int deleteWhere(Class<T> cla, String field, String[] value) {
    return liteOrm.delete(cla, new WhereBuilder(cla).where(field + "!=?", value));
}
 
开发者ID:Alex-Jerry,项目名称:LLApp,代码行数:11,代码来源:DbUtils.java


示例14: deleteWhere

import com.litesuits.orm.db.assit.WhereBuilder; //导入依赖的package包/类
/**
 * 删除所有 某字段等于 Vlaue的值
 *
 * @param cla
 * @param field
 * @param value
 */
public static <T> void deleteWhere(Class<T> cla, String field, String[] value) {
    sLiteOrm.delete(cla, WhereBuilder.create(cla).where(field + "=?", value));
}
 
开发者ID:elffy,项目名称:AbroadEasy,代码行数:11,代码来源:LiteOrmDBUtil.java


示例15: update

import com.litesuits.orm.db.assit.WhereBuilder; //导入依赖的package包/类
/**
 * update model use custom where clause.
 *
 * @return number of affected rows
 */
int update(WhereBuilder builder, ColumnsValue cvs, ConflictAlgorithm conflictAlgorithm);
 
开发者ID:litesuits,项目名称:android-lite-orm,代码行数:7,代码来源:DataBase.java


示例16: delete

import com.litesuits.orm.db.assit.WhereBuilder; //导入依赖的package包/类
/**
 * delete by custem where syntax
 *
 * @return the number of affected rows
 * @deprecated use {@link #delete(WhereBuilder)} instead.
 */
<T> int delete(Class<T> claxx, WhereBuilder where);
 
开发者ID:litesuits,项目名称:android-lite-orm,代码行数:8,代码来源:DataBase.java



注:本文中的com.litesuits.orm.db.assit.WhereBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IGuiLexiconEntry类代码示例发布时间:2022-05-22
下一篇:
Java DataCopyReducer类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap