Skip to content

Add MultiColumn Unique Table constraint support#389

Merged
sibelius merged 2 commits intochennaione:masterfrom
alfmatos:master
Dec 2, 2015
Merged

Add MultiColumn Unique Table constraint support#389
sibelius merged 2 commits intochennaione:masterfrom
alfmatos:master

Conversation

@alfmatos
Copy link
Copy Markdown
Contributor

Reused the Unique constraint on the Table, to provide a qui way to implement unique constraints across multiple fields. It's a rather simple approach, but gets the job done.

@Unique("a, b")
public class IntegerUniqueAnnotatedModel extends SugarRecord {

    private int a;
    private int b;

    public IntegerUniqueAnnotatedModel() {}

    public IntegerUniqueAnnotatedModel(int a, int b) {
        this.a = a;
        this.b = b;
    }

    public int getA() { return a; }
    public int getB() { return b; }
}

@sibelius sibelius added this to the 2.0.0 milestone Nov 24, 2015
@sibelius sibelius merged commit 98f8df5 into chennaione:master Dec 2, 2015
@sibelius
Copy link
Copy Markdown
Contributor

sibelius commented Dec 2, 2015

@alfmatos thanks

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants