Unique constraint not created in JPA

后端 未结 5 1507
抹茶落季
抹茶落季 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:54

    More suggestions than a real answer...

    • you should clarify which JPA provider (and the version) you are using for such questions.

    • I notice that one of your column is part of a ManyToOne association, this might be a "special" case not well handled by your JPA provider. By not well handled, I mean bug. I'd check the issue tracker for an existing issue (and maybe create a new one, your case seems JPA compliant).

提交回复
热议问题