Should each and every table have a primary key?

后端 未结 15 1123
甜味超标
甜味超标 2020-11-22 07:00

I\'m creating a database table and I don\'t have a logical primary key assigned to it. So, I\'m thinking about leaving it without a primary key, but I\'m feeling a bit guilt

15条回答
  •  天命终不由人
    2020-11-22 07:25

    If you are using Hibernate its not possible to create an Entity without a primary key. This issues can create problem if you are working with an existing database which was created with plain sql/ddl scripts, and no primary key was added

提交回复
热议问题