Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doctrine - Table without primary keys

Tags:

doctrine

I use doctrine. It's possible to generate entities who based on a database with table (important) without primary key ? The DB is for Chacal XXI (an application) and 1 or 2 tables have not primary keys, i can't add primary key manually.

like image 572
user2839159 Avatar asked Oct 08 '13 09:10

user2839159


1 Answers

No. From https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/basic-mapping.html#identifiers-primary-keys :

Every entity class must have an identifier/primary key. You can select the field that serves as the identifier with the @Id annotation.

like image 116
Flip Avatar answered Oct 31 '22 00:10

Flip