forked from InfinitumFramework/Infinitum-ORM
-
Notifications
You must be signed in to change notification settings - Fork 0
Unique
tylertreat edited this page Jan 17, 2013
·
1 revision
The Unique
annotation is used to indicate if an entity class's field is unique to the table when being persisted to the database. More concisely, this annotation is used to define a unique constraint on a column. This has no effect on a field that is marked transient.
The following example shows how the field mBar
is made unique.
public class Foo {
@Unique
private int mBar;
public int getBar() {
return mBar;
}
public void setBar(int bar) {
mBar = bar;
}
}