@Column(unique=true) does not seem to work

前端 未结 8 635
夕颜
夕颜 2020-12-09 16:37

Even though I set the attribute to be @Column(unique=true), I still insert a duplicate entry.

@Entity
public class Customer {

    @Id
    @Ge         


        
8条回答
  •  被撕碎了的回忆
    2020-12-09 16:45

    I was also facing the similar issue but got it resolved.

    • First, drop the table from Database

        drop table Customer;
      
    • Stop your spring boot application and launch it again.

      This worked for me.

提交回复
热议问题