У меня один из проектов, у меня есть библиотека DBFlow для SQLite.
Проблема возникает, когда я пытаюсь удалить некоторые данные из таблицы.
override fun removeOldEventPlanners(): Single<Boolean> {
LogMgr.v(TAG, "removeOldEventPlanners()")
return Single.create { emitter ->
RXSQLite.rx(SQLite.delete().from(EventPlanner::class.java)
.where(EventPlanner_Table.date_to.lessThan(Date(TimeUtil.getCurrentTime().time - CONST_30_DAYS_IN_MILLISECONDS)))
.or(EventPlanner_Table.deleted.`is`(1)))
.queryList()
.subscribe({ eventPlanners ->
LogMgr.d(TAG, "removeOldEventPlanners queryList() $eventPlanners")
emitter.onSuccess(true)
}, { throwable ->
LogMgr.e(TAG, "removeOldEventPlanners error", throwable)
emitter.onError(throwable)
})
}
}
Это исключение при бросании кода:
java.lang.IllegalArgumentException: Please use query(). The beginning is not a ISelect
at com.raizlabs.android.dbflow.sql.language.Where.checkSelect(Where.java:259)
at com.raizlabs.android.dbflow.sql.language.Where.queryList(Where.java:235)
at com.raizlabs.android.dbflow.rx2.language.RXModelQueriableImpl$2.call(RXModelQueriableImpl.java:61)
at com.raizlabs.android.dbflow.rx2.language.RXModelQueriableImpl$2.call(RXModelQueriableImpl.java:58)
at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:44)
at io.reactivex.Single.subscribe(Single.java:3575)
at io.reactivex.Single.subscribe(Single.java:3561)
at com.fs.wfm.storage.dbflow.DBFlowWfmStorageRepo$removeOldEventPlanners$1.subscribe(DBFlowWfmStorageRepo.kt:112)
at io.reactivex.internal.operators.single.SingleCreate.subscribeActual(SingleCreate.java:39)
at io.reactivex.Single.subscribe(Single.java:3575)
at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:38)
at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:26)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:841)
У кого-нибудь есть идеи, как это исправить?