簡體   English   中英

Android 中的房間數據庫問題

[英]Room Database Issue in Android

在 Android 房間數據庫中,我得到了這個異常

Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)

這是我的實體 class

@Entity(tableName = "tableName")
public class EntityName implements Serializable {
@PrimaryKey(autoGenerate = true)
private int userId;

}

這是我的道界面

@Dao
interface DaoName {
@get:Query("SELECT * FROM tableName")
val all: ArrayList<EntityName>

@Insert
fun insert(entiname: EntityName?):Long

@Delete
fun delete(entiname: EntityName?)

@Update
fun update(entiname: EntityName?)

}

我在房間數據庫中也遇到了這個問題

利用

List<EntityName>

代替

ArrayList<EntityName>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM