Skip to content

add default value and pk autoincrement#349

Open
joinee0208 wants to merge 1 commit into
greenrobot:masterfrom
joinee0208:master
Open

add default value and pk autoincrement#349
joinee0208 wants to merge 1 commit into
greenrobot:masterfrom
joinee0208:master

Conversation

@joinee0208

Copy link
Copy Markdown

hi! the request include two features.

1:add property's default value.user can use like follows:
table.addIntProperty("UpdateAt").defValue("0");

2:add one more constructor.If the primary key is set to autoincrement,then the primary key column need not to be valued.as follows:

public class Demo {

    private Long id;//the id is primary key.
    private Long UpdateAt;

    public Demo() {
    }
    public Demo(Long UpdateAt) {

        if(this.UpdateAt==null)this.UpdateAt = 0l;
    }
    public Demo(Long id,Long UpdateAt) {
        this.id = id;
        if(this.UpdateAt==null)this.UpdateAt = 0l;
    }
    .
    .
    .
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant