de.greenrobot.dao.query.WhereCondition Java Examples

The following examples show how to use de.greenrobot.dao.query.WhereCondition. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LuaManager.java    From MiBandDecompiled with Apache License 2.0 6 votes vote down vote up
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;
    }
}
 
Example #2
Source File: LuaAction.java    From MiBandDecompiled with Apache License 2.0 6 votes vote down vote up
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();
}
 
Example #3
Source File: LuaAction.java    From MiBandDecompiled with Apache License 2.0 6 votes vote down vote up
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();
}
 
Example #4
Source File: GreenDaoUtils.java    From UltimateAndroid with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example #5
Source File: LuaAction.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
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();
}
 
Example #6
Source File: LuaAction.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
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();
}
 
Example #7
Source File: LuaListAdapter.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example #8
Source File: GreenDaoUtils.java    From UltimateAndroid with Apache License 2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example #9
Source File: GreenDaoUtils.java    From UltimateAndroid with Apache License 2.0 5 votes vote down vote up
/**
 * @see #getList(de.greenrobot.dao.AbstractDao, de.greenrobot.dao.Property, de.greenrobot.dao.query.WhereCondition, de.greenrobot.dao.query.WhereCondition...)
 * @param dao
 * @param whereCondition
 * @param whereConditions
 * @return
 */
public static List getList(AbstractDao dao, WhereCondition whereCondition, WhereCondition... whereConditions) {
    setIfLog();
    List indexFavList = dao.queryBuilder()
            .where(whereCondition, whereConditions)
            .list();
    return indexFavList;
}
 
Example #10
Source File: GreenDaoUtils.java    From UltimateAndroid with Apache License 2.0 5 votes vote down vote up
public static List getList(AbstractDao dao, WhereCondition cond, WhereCondition... condMore) {
    setIfLog();
    List indexFavList = dao.queryBuilder()
            .where(cond, condMore)
            .list();
    return indexFavList;
}
 
Example #11
Source File: GreenDaoUtils.java    From UltimateAndroid with Apache License 2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example #12
Source File: GreenDaoUtils.java    From UltimateAndroid with Apache License 2.0 5 votes vote down vote up
/**
 * @see #getList(de.greenrobot.dao.AbstractDao, de.greenrobot.dao.Property, de.greenrobot.dao.query.WhereCondition, de.greenrobot.dao.query.WhereCondition...)
 * @param dao
 * @param whereCondition
 * @param whereConditions
 * @return
 */
public static List getList(AbstractDao dao, WhereCondition whereCondition, WhereCondition... whereConditions) {
    setIfLog();
    List indexFavList = dao.queryBuilder()
            .where(whereCondition, whereConditions)
            .list();
    return indexFavList;
}
 
Example #13
Source File: Property.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public WhereCondition eq(Object obj)
{
    return new de.greenrobot.dao.query.WhereCondition.PropertyCondition(this, "=?", obj);
}
 
Example #14
Source File: GreenDaoUtils.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
public static QueryBuilder getQueryBuilder(AbstractDao dao, WhereCondition cond, WhereCondition... condmore) {
    setIfLog();
    QueryBuilder qb = dao.queryBuilder();
    qb.where(cond, condmore);
    return qb;
}
 
Example #15
Source File: GreenDaoUtils.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
public static List queryBuilderList(AbstractDao dao, WhereCondition cond, WhereCondition... condmore) {
    return getQueryBuilder(dao, cond, condmore).list();
}
 
Example #16
Source File: GreenDaoUtils.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
public static LazyList queryBuilderLazyList(AbstractDao dao, WhereCondition cond, WhereCondition... condmore) {
    return getQueryBuilder(dao, cond, condmore).listLazy();
}
 
Example #17
Source File: GreenDaoUtils.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
public static QueryBuilder getQueryBuilder(AbstractDao dao, WhereCondition cond, WhereCondition... condmore) {
    setIfLog();
    QueryBuilder qb = dao.queryBuilder();
    qb.where(cond, condmore);
    return qb;
}
 
Example #18
Source File: GreenDaoUtils.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
public static void deleteByCondition(AbstractDao dao, WhereCondition cond, WhereCondition... condmore) {
    setIfLog();
    QueryBuilder qb = dao.queryBuilder();
    qb.where(cond, condmore).buildDelete().executeDeleteWithoutDetachingEntities();

}
 
Example #19
Source File: GreenDaoUtils.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
public static QueryBuilder getQueryBuilder(AbstractDao dao, WhereCondition cond, WhereCondition... condmore) {
    setIfLog();
    QueryBuilder qb = dao.queryBuilder();
    qb.where(cond, condmore);
    return qb;
}
 
Example #20
Source File: Property.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public transient WhereCondition notIn(Object aobj[])
{
    StringBuilder stringbuilder = new StringBuilder(" NOT IN (");
    SqlUtils.appendPlaceholders(stringbuilder, aobj.length).append(')');
    return new de.greenrobot.dao.query.WhereCondition.PropertyCondition(this, stringbuilder.toString(), aobj);
}
 
Example #21
Source File: Property.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public WhereCondition between(Object obj, Object obj1)
{
    return new de.greenrobot.dao.query.WhereCondition.PropertyCondition(this, " BETWEEN ? AND ?", new Object[] {
        obj, obj1
    });
}
 
Example #22
Source File: Property.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public WhereCondition ge(Object obj)
{
    return new de.greenrobot.dao.query.WhereCondition.PropertyCondition(this, ">=?", obj);
}
 
Example #23
Source File: Property.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public WhereCondition gt(Object obj)
{
    return new de.greenrobot.dao.query.WhereCondition.PropertyCondition(this, ">?", obj);
}
 
Example #24
Source File: Property.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public WhereCondition in(Collection collection)
{
    return in(collection.toArray());
}
 
Example #25
Source File: Property.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public transient WhereCondition in(Object aobj[])
{
    StringBuilder stringbuilder = new StringBuilder(" IN (");
    SqlUtils.appendPlaceholders(stringbuilder, aobj.length).append(')');
    return new de.greenrobot.dao.query.WhereCondition.PropertyCondition(this, stringbuilder.toString(), aobj);
}
 
Example #26
Source File: Property.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public WhereCondition isNotNull()
{
    return new de.greenrobot.dao.query.WhereCondition.PropertyCondition(this, " IS NOT NULL");
}
 
Example #27
Source File: Property.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public WhereCondition isNull()
{
    return new de.greenrobot.dao.query.WhereCondition.PropertyCondition(this, " IS NULL");
}
 
Example #28
Source File: Property.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public WhereCondition le(Object obj)
{
    return new de.greenrobot.dao.query.WhereCondition.PropertyCondition(this, "<=?", obj);
}
 
Example #29
Source File: Property.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public WhereCondition like(String s)
{
    return new de.greenrobot.dao.query.WhereCondition.PropertyCondition(this, " LIKE ?", s);
}
 
Example #30
Source File: Property.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public WhereCondition lt(Object obj)
{
    return new de.greenrobot.dao.query.WhereCondition.PropertyCondition(this, "<?", obj);
}