입력:23/05/29수정:24/01/05

room database annotation 에러

Problem


Not sure how to convert a Cursor to this method's return type (java.lang.Object).

* Unused parameter: continuation
* Not sure how to handle query method's return type (java.lang.Object). DELETE query methods must either return void or int (the number of deleted rows).
* Query method parameters should either be a type that can be converted into a database column or a List / Array that contains such type. You can consider adding a Type Adapter for this.
* Unused parameter: continuation
* Not sure how to handle query method's return type (java.lang.Object). UPDATE query methods must either return void or int (the number of updated rows).
* Query method parameters should either be a type that can be converted into a database column or a List / Array that contains such type. You can consider adding a Type Adapter for this.
* Unused parameter: continuation
* The return value includes a POJO with a @Relation. It is usually desired to annotate this method with @Transaction to avoid possibility of inconsistent results between the POJO and its relations. See https://developer.android.com/reference/androidx/room/Transaction.html for details.
* The query returns some columns [startTS, amount, price, event_type, detail_memo, last_updated] which are not used by java.lang.Object. You can use @ColumnInfo annotation on the fields to specify the mapping. You can annotate the method with @RewriteQueriesToDropUnusedColumns to direct Room to rewrite your query to avoid fetching unused columns. You can suppress this warning by annotating the method with @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH). Columns returned by the query: startTS, amount, price, event_type, detail_memo, last_updated. Fields in java.lang.Object: .
* Not sure how to convert a Cursor to this method's return type (java.lang.Object).
* Query method parameters should either be a type that can be converted into a database column or a List / Array that contains such type. You can consider adding a Type Adapter for this.
* Unused parameter: continuation
* The query returns some columns [startTS, amount, price, event_type, detail_memo, last_updated] which are not used by java.lang.Object. You can use @ColumnInfo annotation on the fields to specify the mapping. You can annotate the method with @RewriteQueriesToDropUnusedColumns to direct Room to rewrite your query to avoid fetching unused columns. You can suppress this warning by annotating the method with @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH). Columns returned by the query: startTS, amount, price, event_type, detail_memo, last_updated. Fields in java.lang.Object: .
* Not sure how to convert a Cursor to this method's return type (java.lang.Object).
* Query method parameters should either be a type that can be converted into a database column or a List / Array that contains such type. You can consider adding a Type Adapter for this.
* Unused parameter: continuation
* Not sure how to handle query method's return type (java.lang.Object). DELETE query methods must either return void or int (the number of deleted rows).
* Query method parameters should either be a type that can be converted into a database column or a List / Array that contains such type. You can consider adding a Type Adapter for this.
* Unused parameter: continuation
* Not sure how to handle query method's return type (java.lang.Object). UPDATE query methods must either return void or int (the number of updated rows).
* Query method parameters should either be a type that can be converted into a database column or a List / Array that contains such type. You can consider adding a Type Adapter for this.
* Unused parameter: continuation
* Not sure how to handle query method's return type (java.lang.Object). UPDATE query methods must either return void or int (the number of updated rows).
* Query method parameters should either be a type that can be converted into a database column or a List / Array that contains such type. You can consider adding a Type Adapter for this.
* Unused parameter: continuation
* Not sure how to handle query method's return type (java.lang.Object). UPDATE query methods must either return void or int (the number of updated rows).
* Query method parameters should either be a type that can be converted into a database column or a List / Array that contains such type. You can consider adding a Type Adapter for this.
* Unused parameter: continuation
* Not sure how to handle query method's return type (java.lang.Object). UPDATE query methods must either return void or int (the number of updated rows).
* Query method parameters should either be a type that can be converted into a database column or a List / Array that contains such type. You can consider adding a Type Adapter for this.

Necessary Context

Solutions

room database annotation 에러


apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: "androidx.navigation.safeargs.kotlin"
apply plugin: 'com.google.firebase.crashlytics'

순서 맞출 것

Note


토픽:
영역: 영역/개발
타입: 타입/에러