loadAll()---查询所有数据
App.getDaoInstant().getTestDao().loadAll();
条件查询eq 获取对象
App.getDaoInstant().getTestDao().queryBuilder().where(TestDao.Properties.Name.eq("鸭鸭")).unique();
notEq(不是相等的属性) where我理解为与条件
App.getDaoInstant().getTestDao().queryBuilder().where(TestDao.Properties.UploadStatus.eq("0"),TestDao.Properties.State.notEq("0")).list;
whereOr 条件或 orderAsc排序
QueryBuilder qb = App.getDaoInstant().getTmrTicketDao().queryBuilder(); tList = qb.whereOr(qb.and(TmrTicketDao.Properties.UploadStatus.eq("0"), TmrTicketDao.Properties.PlanTime.ge(beginTime), TmrTicketDao.Properties.ExecuteStatus.notEq("2"), TmrTicketDao.Properties.Status.eq("1")), qb.and(TmrTicketDao.Properties.UploadStatus.eq("0"), TmrTicketDao.Properties.PlanTime.ge(beginTime), TmrTicketDao.Properties.ExecuteStatus.eq("1"), TmrTicketDao.Properties.Status.eq("0"))).orderAsc(TmrTicketDao.Properties.PlanOrder).list();
数据insertOrReplace后 需要提交才能保存
App.getDaoInstant().getDatabase().setTransactionSuccessful();
App.getDaoInstant().getDatabase().endTransaction();
部分记录,后遇到会持续更新