door
door copied to clipboard
@Entity name must match class name
When creating tables.. the tableName needs to match the class name or it will throw a runtime error when you try to insert into the database. The database does get created fine from what i saw, but inserts fail
Works:
@Entity(tableName = "ChannelEntity")
data class ChannelEntity(var name: String = ""
Doesnt work
@Entity(tableName = "channel")
data class ChannelEntity(var name: String = ""
I dont have the exact exception.. but it was in an InvalidationTracker and it was complaining about a table not being found (it listed the name of the class instead of the name i gave the table)
Support for tableName = "something other than class name" would be appreciated as that is supported in Room