编译时:
CREATE TABLE IF NOT EXISTS `SeasonMasterDB`
(`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`id` TEXT PRIMARY KEY AUTOINCREMENT, `name` TEXT
);
这就是您收到错误的原因。请帮帮我,这是我的代码:
@Table(name = "SeasonMasterDB",database = AppDatabase.class)`enter code here`
public class SeasonMasterDB extends Model {
@PrimaryKey
public Long id;
@Column(name = "id")
public String idValue;
@Column(name = "name")
public String name;
public SeasonMasterDB()
{
}
public SeasonMasterDB(String name,String id)
{
this.idValue = id;
this.name = name;
}
}
答案 0 :(得分:0)
您不能拥有两个名称相同的列。重命名一个id
列。