What I wanna do is, By merging the following two data classes into one, the two tables are divided as they are.
@Entity(tableName = "file")
data class File(
@PrimaryKey
@ColumnInfo(name = "path") var path: String,
@ColumnInfo(name = "date", index = true) var date: Long,
@ColumnInfo(name = "number") var num: Float = -1f
)
@Entity(tableName = "del_file")
data class delFile(
@PrimaryKey
@ColumnInfo(name = "path") var path: String,
@ColumnInfo(name = "date", index = true) var date: Long,
@ColumnInfo(name = "number") var num: Float = -1f
)
The reason I want to manage those two tables separately is that they are used in completely different situations. 'file' will be used in the app's file system, and 'del_file' will be managed only in the recycle bin.
I also thought about adding and managing a column called "is_alive" to the "file" table, but I thought it was a bad structure in that it would be meaningless data in almost all entries and that filtering was required for all queries to be used in the app's file system.
The best way I think is to manage each of the two tables, but I thought I couldn't come up with a better way because I wasn't good enough.
Is there a way to manage the table separately while making that data class one? Or is there a better way?
I would be very, very grateful if you could tell me a good way.