@Retention(value=SOURCE)
@Target(value=FIELD)
public @interface Unique
To have a unique constraint after table creation you can use Index.unique()
Note having both @Unique and Index
is redundant and causes performance decrease
on DB level. See here for more information.
Index.unique()
Available under the Apache License, Version 2.0 - Copyright © 2011-2016 greenrobot.org. All Rights Reserved.