Annotation Interface UniqueConstraint
Annotation to define a unique constraint on one or more database columns.
This annotation ensures that the specified columns have unique values in the database. The column names should correspond to the actual column names in the database, not the entity class field names.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionString[]
Specifies the names of the database columns that should have unique values.
-
Element Details
-
columnNames
String[] columnNamesSpecifies the names of the database columns that should have unique values.- Returns:
- An array of column names enforcing uniqueness.
- Default:
{}
-