GreenDao 3.0 出现 UNIQUE constraint failed

来源:互联网 发布:淘宝旺旺头像 编辑:程序博客网 时间:2024/06/03 09:31

insert的时候id出现重复。

查到解决办法

http://stackoverflow.com/questions/34980137/unique-constraint-failed-sqlite-database-android

@Idprivate long schedule_id;

于是加上(autoincrement=true)

还是不行,发现是要用Long对象

@Id(autoincrement = true)private Long schedule_id;
这样才解决。。

0 0
原创粉丝点击