I work with MySQL/OPENJPA. I have a task to impose uniqueness in one of the table columns. From what I see I can do this in 2 ways.
- Use Alter Table ADD UNIQUE
OR
- Using JPA annotation: @Table(name="", uniqueConstraints=@Unique(columnNames=""))
Which way is correct? Or maybe using both at the same time?
Aucun commentaire:
Enregistrer un commentaire