litesuits / android-lite-orm

LiteOrm is a fast, small, powerful ORM framework for Android. LiteOrm makes you do CRUD operarions on SQLite database with a sigle line of code efficiently.
http://litesuits.com?form=gorm
Apache License 2.0
1.49k stars 361 forks source link

WhereBuilder 可以构建 IS NULL 或者 IS NOT NULL 的条件吗 #59

Closed shitb closed 7 years ago

shitb commented 7 years ago

我想查找出来某个字段是空的数据,需要如何构建wherebuilder

HsiangLeekwok commented 7 years ago

QueryBuilder<YourClass> query = new QueryBuilder<>(YourClass.class)
                .whereEquals(YourCondition1, YourValue)
                .whereAppendAnd()
                .whereAppend(YourCondition2 + " IS NULL");
                // .whereAppend(YourCondition2 + " = ?", new String[] { "Hi" });