Skip to content

@Entity name must match class name #9

@gonemad

Description

@gonemad

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions