用途@UniqueConstraint:
@UniqueConstraint
@Table( uniqueCOnstraints= @UniqueConstraint(columnNames={"author_id", "number"}))@Entityclass Book extends Model { @ManyToOne @JoinColumn(name = "author_id") User author; int number; }