Greendao inserts the data UNIQUE constraint failed: PURCHASE_ORDER_TABLE. _ id (code 1555 ),

Source: Internet
Author: User

Greendao inserts the data UNIQUE constraint failed: PURCHASE_ORDER_TABLE. _ id (code 1555 ),

Greendao inserts the data UNIQUE constraint failed: PURCHASE_ORDER_TABLE. _ id (code 1555)

@Entitypublic class ConnectPeople {    @Id(autoincrement=true)    private Long id;    private String name;    private String mobile;    public ConnectPeople(String name, String mobile) {        this.name = name;        this.mobile = mobile;    }    @Generated(hash = 910981689)    public ConnectPeople(Long id, String name, String mobile) {        this.id = id;        this.name = name;        this.mobile = mobile;    }    @Generated(hash = 1759600975)    public ConnectPeople() {    }    public Long getId() {        return id;    }    public void setId(Long id) {        this.id = id;    }    public String getName() {        return name;    }    public void setName(String name) {        this.name = name;    }    public String getMobile() {        return mobile;    }    public void setMobile(String mobile) {        this.mobile = mobile;    }}

Change the id to the Long type. You can skip the Long type parameter when passing parameters in the constructor.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.