only-a-bitwise
only-a-bitwise

Reputation: 85

Android Room - Cannot resolve method/symbol when defining Room tablename, ColumnInfo etc

I'm trying to set up a Room database in my app. Here is a Entity class:

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

@Entity(tablename = "items")
public class ItemEntity {
    @PrimaryKey
    public int id;
    @ColumnInfo(value = "value")
    public float value;
}

Android studio tells me it cannot resolve method tablename and cannot resolve method value. Same with my ItemDao class, where I define a query: @Query("SELECT * FROM items"). Here it tells me it cannot resolve symbol items. I've set up Room in my gradle file, and the android imports are working.

Upvotes: 1

Views: 1953

Answers (1)

Mohru
Mohru

Reputation: 743

The @Entity annotation parameters are case sensitive. Try using tableName instead of tablename.

Upvotes: 1

Related Questions