Unique constraint not created in JPA

后端 未结 5 1519
抹茶落季
抹茶落季 2021-01-18 01:49

I have created the following entity bean, and specified two columns as being unique. Now my problem is that the table is created without the unique constraint, and no errors

5条回答
  •  感动是毒
    2021-01-18 02:43

    I also faced the same issue, but adding unique-key="UK1_test" in the mapping file worked fine.

    create with unique-key="UK1_test" unique="true" in the mapping file created alter table employee add constraint UK1_test unique (addrId)

提交回复
热议问题