In Hibernate I can create a unique key using @NaturalId
on several properties of the entity.
Is there a JPA equivalent annotation, something that is a part of javax.persistence
?
What I usually do is add a unique constraint on the columns, using @Table(uniqueConstraints = @UniqueConstraint(columnNames={column_1, ..., column_n}))