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

Java WhereCondition类代码示例

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

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



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

示例1: getActivityTypeConditions

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
private WhereCondition getActivityTypeConditions(QueryBuilder qb, int[] dbActivityTypes) {
    // What a crappy QueryBuilder API ;-( QueryBuilder.or(WhereCondition[]) with a runtime array length
    // check would have worked just fine.
    if (dbActivityTypes.length == 0) {
        return null;
    }
    Property rawKindProperty = getRawKindSampleProperty();
    if (dbActivityTypes.length == 1) {
        return rawKindProperty.eq(dbActivityTypes[0]);
    }
    if (dbActivityTypes.length == 2) {
        return qb.or(rawKindProperty.eq(dbActivityTypes[0]),
                rawKindProperty.eq(dbActivityTypes[1]));
    }
    final int offset = 2;
    int len = dbActivityTypes.length - offset;
    WhereCondition[] trailingConditions = new WhereCondition[len];
    for (int i = 0; i < len; i++) {
        trailingConditions[i] = rawKindProperty.eq(dbActivityTypes[i + offset]);
    }
    return qb.or(rawKindProperty.eq(dbActivityTypes[0]),
            rawKindProperty.eq(dbActivityTypes[1]),
            trailingConditions);
}
 
开发者ID:scifiswapnil,项目名称:gadgetbridge_artikcloud,代码行数:25,代码来源:AbstractSampleProvider.java


示例2: removeGroupList

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
private void removeGroupList(List<EMGroup> groups) {
    if (null != groups && groups.size() > 0) {
        final DaoSession daoSession = App.getDaoSession();
        final ArrayList<String> id = new ArrayList<>();
        for (EMGroup group : groups) {
            String groupid = group.getGroupId();
            id.add(groupid);
            HXCacheUtils.getInstance().getGroupsHashMap().remove(groupid);
        }
        ArrayList<String> arrayList = new ArrayList<>(HXCacheUtils.getInstance().getGroupsHashMap().keySet());
        EventBus.getDefault().post(new OnGroupsUpdataEvent(arrayList));
        daoSession.runInTx(new Runnable() {
            @Override
            public void run() {
                WhereCondition wc = UserDao.Properties.Avatar.in(id);
                List<UserDO> chatEntityList = daoSession.getUserDao().queryBuilder().where(wc).list();
                daoSession.getUserDao().deleteInTx(chatEntityList);
            }
        });
    }
}
 
开发者ID:tengbinlive,项目名称:info_demo,代码行数:22,代码来源:HXChatManagerInit.java


示例3: removeUserList

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
private void removeUserList(final List<String> usernames) {
    if (null != usernames && usernames.size() > 0) {
        final DaoSession daoSession = App.getDaoSession();
        for (String username : usernames) {
            HXCacheUtils.getInstance().getFriendsHashMap().remove(username);
        }
        ArrayList<String> arrayList = new ArrayList<>(HXCacheUtils.getInstance().getFriendsHashMap().keySet());
        EventBus.getDefault().post(new OnContactUpdataEvent(arrayList));
        EventBus.getDefault().post(new NewMessageEvent());
        daoSession.runInTx(new Runnable() {
            @Override
            public void run() {
                WhereCondition wc = UserDao.Properties.Avatar.in(usernames);
                List<UserDO> chatEntityList = daoSession.getUserDao().queryBuilder().where(wc).list();
                daoSession.getUserDao().deleteInTx(chatEntityList);
            }
        });
    }
}
 
开发者ID:tengbinlive,项目名称:info_demo,代码行数:20,代码来源:HXChatManagerInit.java


示例4: delMsg4

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
public void delMsg4(WhereCondition wherecondition, WhereCondition wherecondition1, WhereCondition wherecondition2, WhereCondition wherecondition3)
{
    QueryBuilder querybuilder = DaoManager.getInstance().getLuaListDao().queryBuilder();
    querybuilder.where(wherecondition, new WhereCondition[0]);
    if (wherecondition1 != null)
    {
        querybuilder.where(wherecondition1, new WhereCondition[0]);
    }
    if (wherecondition2 != null)
    {
        querybuilder.where(wherecondition2, new WhereCondition[0]);
    }
    if (wherecondition3 != null)
    {
        querybuilder.where(wherecondition3, new WhereCondition[0]);
    }
    querybuilder.buildDelete().executeDeleteWithoutDetachingEntities();
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:19,代码来源:LuaAction.java


示例5: getCount4

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
public int getCount4(WhereCondition wherecondition, WhereCondition wherecondition1, WhereCondition wherecondition2, WhereCondition wherecondition3)
{
    QueryBuilder querybuilder = DaoManager.getInstance().getLuaListDao().queryBuilder();
    querybuilder.where(wherecondition, new WhereCondition[0]);
    if (wherecondition1 != null)
    {
        querybuilder.where(wherecondition1, new WhereCondition[0]);
    }
    if (wherecondition2 != null)
    {
        querybuilder.where(wherecondition2, new WhereCondition[0]);
    }
    if (wherecondition2 != null)
    {
        querybuilder.where(wherecondition2, new WhereCondition[0]);
    }
    return (int)querybuilder.count();
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:19,代码来源:LuaAction.java


示例6: getDBLuaFileByVersion

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
private String getDBLuaFileByVersion(String s)
{
    LuaZipFileDao luazipfiledao = DaoManager.getInstance().getLuaZipFileDao();
    int j = (int)luazipfiledao.count();
    Debug.i("chenee", (new StringBuilder()).append("lzipDao.count:").append(j).toString());
    if (j > 0)
    {
        QueryBuilder querybuilder = luazipfiledao.queryBuilder();
        Property aproperty[] = new Property[1];
        aproperty[0] = de.greenrobot.daobracelet.LuaZipFileDao.Properties.Version;
        querybuilder.orderDesc(aproperty);
        querybuilder.where(de.greenrobot.daobracelet.LuaZipFileDao.Properties.Version.eq(s), new WhereCondition[0]);
        LuaZipFile luazipfile = (LuaZipFile)querybuilder.listLazy().get(0);
        String s1 = luazipfile.getVersion();
        Debug.i("chenee", (new StringBuilder()).append("luaZipFile.version:").append(s1).toString());
        return unzip(luazipfile.getZipFile());
    } else
    {
        Debug.e("chenee", (new StringBuilder()).append("read DB zip failed,version:").append(s).toString());
        return null;
    }
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:23,代码来源:LuaManager.java


示例7: getList

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
public static List getList(AbstractDao dao, Property orderProperty, WhereCondition cond, WhereCondition... condMore) {
    setIfLog();
    List indexFavList = dao.queryBuilder()
            .where(cond, condMore)
            .orderAsc(orderProperty)
            .list();
    return indexFavList;
}
 
开发者ID:DroidKOF,项目名称:pineapple,代码行数:9,代码来源:GreenDaoUtils.java


示例8: getClauseForActivityType

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
private WhereCondition[] getClauseForActivityType(QueryBuilder qb, int activityTypes) {
    if (activityTypes == ActivityKind.TYPE_ALL) {
        return NO_CONDITIONS;
    }

    int[] dbActivityTypes = ActivityKind.mapToDBActivityTypes(activityTypes, this);
    WhereCondition activityTypeCondition = getActivityTypeConditions(qb, dbActivityTypes);
    return new WhereCondition[] { activityTypeCondition };
}
 
开发者ID:scifiswapnil,项目名称:gadgetbridge_artikcloud,代码行数:10,代码来源:AbstractSampleProvider.java


示例9: delMsg

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
public void delMsg(WhereCondition wherecondition, WhereCondition wherecondition1)
{
    QueryBuilder querybuilder = DaoManager.getInstance().getLuaListDao().queryBuilder();
    querybuilder.where(wherecondition, new WhereCondition[0]);
    if (wherecondition1 != null)
    {
        querybuilder.where(wherecondition1, new WhereCondition[0]);
    }
    querybuilder.buildDelete().executeDeleteWithoutDetachingEntities();
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:11,代码来源:LuaAction.java


示例10: getCount

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
public int getCount(WhereCondition wherecondition, WhereCondition wherecondition1)
{
    QueryBuilder querybuilder = DaoManager.getInstance().getLuaListDao().queryBuilder();
    querybuilder.where(wherecondition, new WhereCondition[0]);
    if (wherecondition1 != null)
    {
        querybuilder.where(wherecondition1, new WhereCondition[0]);
    }
    return (int)querybuilder.count();
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:11,代码来源:LuaAction.java


示例11: refreshList

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
public void refreshList()
{
    LuaListDao lualistdao = DaoManager.getInstance().getLuaListDao();
    String s = getDate();
    QueryBuilder querybuilder = lualistdao.queryBuilder().where(de.greenrobot.daobracelet.LuaListDao.Properties.Date.eq(s), new WhereCondition[0]).where(de.greenrobot.daobracelet.LuaListDao.Properties.Type.notEq("8888"), new WhereCondition[0]).where(de.greenrobot.daobracelet.LuaListDao.Properties.Type.notEq("9999"), new WhereCondition[0]);
    Property aproperty[] = new Property[1];
    aproperty[0] = de.greenrobot.daobracelet.LuaListDao.Properties.Id;
    List list = querybuilder.orderDesc(aproperty).list();
    Collections.sort(list, new MyComparator());
    setList(list);
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:12,代码来源:LuaListAdapter.java


示例12: getList

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
/**
 * Executes the query and returns the result as a list containing all entities loaded into memory.
 * @param dao
 * @param orderProperty
 * @param whereCondition
 * @param whereConditions
 * @return
 */
public static List getList(AbstractDao dao, Property orderProperty, WhereCondition whereCondition, WhereCondition... whereConditions) {
    setIfLog();
    List indexFavList = dao.queryBuilder()
            .where(whereCondition, whereConditions)
            .orderAsc(orderProperty)
            .list();
    return indexFavList;
}
 
开发者ID:cymcsg,项目名称:UltimateAndroid,代码行数:17,代码来源:GreenDaoUtils.java


示例13: queryBuilderList

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
public static List queryBuilderList(AbstractDao dao, WhereCondition cond, WhereCondition... condmore) {
    return getQueryBuilder(dao, cond, condmore).list();
}
 
开发者ID:DroidKOF,项目名称:pineapple,代码行数:4,代码来源:GreenDaoUtils.java


示例14: queryBuilderLazyList

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
public static LazyList queryBuilderLazyList(AbstractDao dao, WhereCondition cond, WhereCondition... condmore) {
    return getQueryBuilder(dao, cond, condmore).listLazy();
}
 
开发者ID:DroidKOF,项目名称:pineapple,代码行数:4,代码来源:GreenDaoUtils.java


示例15: getQueryBuilder

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
public static QueryBuilder getQueryBuilder(AbstractDao dao, WhereCondition cond, WhereCondition... condmore) {
    setIfLog();
    QueryBuilder qb = dao.queryBuilder();
    qb.where(cond, condmore);
    return qb;
}
 
开发者ID:DroidKOF,项目名称:pineapple,代码行数:7,代码来源:GreenDaoUtils.java


示例16: deleteByCondition

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
public static void deleteByCondition(AbstractDao dao, WhereCondition cond, WhereCondition... condmore) {
    setIfLog();
    QueryBuilder qb = dao.queryBuilder();
    qb.where(cond, condmore).buildDelete().executeDeleteWithoutDetachingEntities();

}
 
开发者ID:DroidKOF,项目名称:pineapple,代码行数:7,代码来源:GreenDaoUtils.java


示例17: classification

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
private void classification(UserActionDao dao) {
    WhereCondition wcAgr = UserActionDao.Properties.Type.eq(TYPE_AGREEMENT);
    WhereCondition wcHab = UserActionDao.Properties.Type.eq(TYPE_HABIT);
    arrayListAgreement = (ArrayList<UserAction>) dao.queryBuilder().where(wcAgr).list();
    arrayListHabit = (ArrayList<UserAction>) dao.queryBuilder().where(wcHab).list();
}
 
开发者ID:tengbinlive,项目名称:aibao_demo,代码行数:7,代码来源:UserActionDOManager.java


示例18: between

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
public WhereCondition between(Object obj, Object obj1)
{
    return new de.greenrobot.dao.query.WhereCondition.PropertyCondition(this, " BETWEEN ? AND ?", new Object[] {
        obj, obj1
    });
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:7,代码来源:Property.java


示例19: eq

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
public WhereCondition eq(Object obj)
{
    return new de.greenrobot.dao.query.WhereCondition.PropertyCondition(this, "=?", obj);
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:5,代码来源:Property.java


示例20: ge

import de.greenrobot.dao.query.WhereCondition; //导入依赖的package包/类
public WhereCondition ge(Object obj)
{
    return new de.greenrobot.dao.query.WhereCondition.PropertyCondition(this, ">=?", obj);
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:5,代码来源:Property.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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