Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MultiColumn Unique Table constraint support #389

Merged
merged 2 commits into from
Dec 2, 2015

Conversation

alfmatos
Copy link
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
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