GreenDao3.0查询

1.loadAll();----------查询所有的数据
      long    count()  // 获取结果数量


2.条件查询---查询单个字段 获取对象-----eq方法
TaskPath taskPath = mTaskPathDao.queryBuilder().where(TaskPathDao.Properties.Task_name.eq("小红帽")).unique();
unique()  // 返回唯一结果或者 null


3.条件查询---查询不是该字段内容的 对象有哪些---notEq方法
List mtaskPath = mTaskPathDao.queryBuilder().where(TaskPathDao.Properties.Task_name.notEq("小黄人")).list();
list()  // 返回结果集进内存


 

4、单条件查询,用where

.where(SymptomGreenBean2Dao.Properties.SymptomPY.eq(str))

   或的条件查询,用whereOr

.whereOr(SymptomGreenBean2Dao.Properties.SymptomName.eq(str),SymptomGreenBean2Dao.Properties.SymptomPY.eq(str))

5、模糊查询(like):

whereOr(SymptomDao.Properties.Name.like("%" + str2 + "%"))
                        



 

猜你喜欢

转载自blog.csdn.net/songzi1228/article/details/81480785