I have a select query in Room DB that collect data...
# android
a
I have a select query in Room DB that collect data from multiple tables, so I created a custom data class suitable for those returned data, now, I want to add an extra attribute to the class without returning it from the query, when I added the
extraAtt
I got a compiler error, how do I deal with that?
Copy code
data class MyClass(val a: Int, val b: int, val extraAtt: Int)
------------
@Query("select a, b from tableName")
fun getData(): List<MyClass>
@ignore
doesn't help me
a
Did you update the Database Version with Migration Option!
a
No. I figured out the solution, I should annotate the class with @JvmOverloads and give the extraAtt a default value!
1
z
I think you should call fallBackToDestructibeMigration on creating retrofit instance this may help.