Annotation Type Unique


  • @Retention(SOURCE)
    @Target(FIELD)
    public @interface Unique
    Marks property should have a UNIQUE constraint during table creation. This annotation is also applicable with @ToOne without additional foreign key property

    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.

    See Also:
    Index.unique()