我创建了以下实体 bean,并将两列指定为唯一的。现在我的问题是该表是在没有唯一约束的情况下创建的,并且日志中没有错误。有人有想法吗?
@Entity
@Table(name = "cm_blockList", uniqueConstraints = @UniqueConstraint(columnNames = {"terminal", "blockType"}))
public class BlockList {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
@ManyToOne(cascade = CascadeType.PERSIST)
@JoinColumn(name="terminal")
private Terminal terminal;
@Enumerated(EnumType.STRING)
private BlockType blockType;
private String regEx;
}