我有LoggedInUserEntity,UserRecentSearch最后一个在哪里有 foreignKeys LoggedInUserEntity。当我想删除LoggedInUserEntity时,如果数据库中只有 no 是可能UserRecentSearch的。
我该如何删除?
@Query("DELETE FROM loggedInUser")
我如何使用关系?
@Entity(tableName = "recentSearches",
indices = arrayOf(Index(value = "userId",name = "idr")),
foreignKeys = arrayOf(ForeignKey(
entity = LoggedInUserEntity::class,
parentColumns = arrayOf("id"),
childColumns = arrayOf("userId"))
))
我如何删除LoggedInUserEntity现有的UserRecentSearch?