DBFlow SQLite.delete() throwing java.lang.IllegalArgumentException: 请使用 query()

DBFlow SQLite.delete() throwing java.lang.IllegalArgumentException: Please use query()

我是其中一个项目,我有用于 SQLite 的 DBFlow 库。

当我试图从 Table 中删除一些数据时出现问题。

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.call(RXModelQueriableImpl.java:61)
    at com.raizlabs.android.dbflow.rx2.language.RXModelQueriableImpl.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.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)

有人知道如何解决吗?

delete 没有 return 值,因此使用 queryList() 到 return 值作为列表是不正确的,可以在堆栈跟踪中看到。